Author |
Message
|
rb1 |
Posted: Sun Jan 30, 2011 9:55 pm Post subject: Mulitpart messages |
|
|
Newbie
Joined: 06 Oct 2006 Posts: 3
|
I am getting an input message with the below structure. All these are fixed width structures
Code: |
- File Header
- Record header
- Record Detail
- File Trailer |
File header and trailer can occur only once, while the there could be multiple record headers and multiple record details for each of these record headers. The first 3 characters of these records can be used to identify the record type also. For eg, the message could be like this
Code: |
FHD01AABBCCDD
RHD01abcd
RDD01abcdefg
RHD02abcd
RDD02abcdefg
RDD02abcdijk
FTD01abc |
The number of occurrences of the record header and detail are not available in the message and the only way to identity which record is by parsing the first 3 characters. Is there any way of using the multi part message options to model this structure?
I have the options of reading the data as a BLOB and doing the custom parsing using create field options in ESQL, but I would like to see if there is a direct way of doing this. Please let me know your suggestions (I am using MB 6.1).
Regards,
RB |
|
Back to top |
|
 |
santnmq |
Posted: Sun Jan 30, 2011 10:03 pm Post subject: |
|
|
Centurion
Joined: 11 Jan 2011 Posts: 125
|
your's is the custom message, this has to be parsed according to the structure.
I don't think there will be some other way. |
|
Back to top |
|
 |
smdavies99 |
Posted: Sun Jan 30, 2011 10:23 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
This sort of this is standard fare for the MRM parser.
Take a look at some of the many posts like this in this forum. You will soon get the gist.
Do you have a CopyBook that describes the format? If you do then just use that to create the message set.
simples. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
RB |
Posted: Sun Jan 30, 2011 11:34 pm Post subject: |
|
|
Acolyte
Joined: 23 May 2006 Posts: 56
|
I did search the forum, but I could find only scenarios where we have a message identity field defined in the header. In this case, for each record the first 3 characters define the record type.
Yes, I do have separate copy book structures for each these record layouts and I can create one message set having all these messages. But I am not sure how at run time the parser would be able to pick the correct message to parse a record.
Regards,
RB |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Jan 31, 2011 12:40 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Why don't you try it and see. Put a Trace node set to ${Root} after the input node. You may be pleasantly surprised by what you see. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
RB |
Posted: Mon Jan 31, 2011 2:19 am Post subject: |
|
|
Acolyte
Joined: 23 May 2006 Posts: 56
|
I am sorry, may be I am not really getting what you are saying!
When I create a message set, I will have 4 messages in that corresponding to each of the records. In the MQInput node, I can specify only one message type at one point and it will fail to parse the data. The output in the trace will not have anything under the MRM tree!
Could you please provide some more details on how the message should be built? Am I doing something wrong here.. |
|
Back to top |
|
 |
fatherjack |
Posted: Mon Jan 31, 2011 2:25 am Post subject: |
|
|
 Knight
Joined: 14 Apr 2010 Posts: 522 Location: Craggy Island
|
|
Back to top |
|
 |
kimbert |
Posted: Mon Jan 31, 2011 5:30 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I think you are misunderstanding some MRM words. The key facts are:
- Your message is not 'multi-part'. It contains more than one type of element.
- the 3-character header is a 'Tag'. It tells the parser which type of element it is parsing ( if you set up your message set correctly ).
So you need a 'Tagged Fixed Length' message model, and fatherjack has correctly pointed you in that direction. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Jan 31, 2011 5:41 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You really have only one message definition.
If you can use the tag on the very first record to determine that the remainder of the records are going to only be a fixed subset of records, then yes you CAN use multi-part messaging. It's not required, you could just as easily use a set of nested choices that are resolved by tags.
But either way, you need to create a tagged/fixed length model anyway - because you have to use the tags to determine the individual records. |
|
Back to top |
|
 |
RB |
Posted: Mon Jan 31, 2011 5:47 am Post subject: |
|
|
Acolyte
Joined: 23 May 2006 Posts: 56
|
Thanks everyone, I will try this and get back incase of any issues...
Regards,
Rijesh |
|
Back to top |
|
 |
|