Author |
Message
|
vmurali_au |
Posted: Tue Aug 22, 2006 9:30 am Post subject: Solved: MRM data not found in output |
|
|
 Voyager
Joined: 26 Mar 2004 Posts: 76
|
I'm constructing a TDS message using Java Compute Node and outputing to the MQ Queue.
After the Java Compute Node the message is like this.
(
(0x01000000):Properties = (
(0x03000000):MessageSet = 'DC8LRAG002001'
(0x03000000):MessageType = 'DT_RESPONSE'
(0x03000000):MessageFormat = 'TDS1'
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Transactional = TRUE
(0x03000000):Persistence = FALSE
(0x03000000):CreationTime = GMTTIMESTAMP '2006-08-22 17:22:24.480'
(0x03000000):ExpirationTime = -1
(0x03000000):Priority = 0
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
(0x03000000):ReplyProtocol = 'MQ'
(0x03000000):Topic = NULL
(0x03000000):ContentType = ''
)
(0x01000000):MQMD = (
(0x03000000):SourceQueue = 'EMP_IN'
(0x03000000):Transactional = TRUE
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Format = 'MQHRF2 '
(0x03000000):Version = 2
(0x03000000):Report = 0
(0x03000000):MsgType = 8
(0x03000000):Expiry = -1
(0x03000000):Feedback = 0
(0x03000000):Priority = 0
(0x03000000):Persistence = 0
(0x03000000):MsgId = X'414d5120574d42202020202020202020cbfbea4420001c1d'
(0x03000000):CorrelId = X'000000000000000000000000000000000000000000000000'
(0x03000000):BackoutCount = 0
(0x03000000):ReplyToQ = ' '
(0x03000000):ReplyToQMgr = 'WMB '
(0x03000000):UserIdentifier = 'mveeraiyan '
(0x03000000):AccountingToken = X'16010515000000ac6a360ee34a0a3e544c536e988e030000000000000000000b'
(0x03000000):ApplIdentityData = ' '
(0x03000000):PutApplType = 11
(0x03000000):PutApplName = '\Supportpac\ih03\rfhutil.exe'
(0x03000000):PutDate = DATE '2006-08-22'
(0x03000000):PutTime = GMTTIME '17:22:24.480'
(0x03000000):ApplOriginData = ' '
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000'
(0x03000000):MsgSeqNumber = 1
(0x03000000):Offset = 0
(0x03000000):MsgFlags = 0
(0x03000000):OriginalLength = -1
)
(0x01000000):MQRFH2 = (
(0x03000000):Version = 2
(0x03000000):Format = ' '
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Flags = 0
(0x03000000):NameValueCCSID = 1208
(0x01000000):mcd = (
(0x01000000):Msd = (
(0x02000000): = 'MRM'
)
(0x01000000):Set = (
(0x02000000): = 'DC8LRAG002001'
)
(0x01000000):Type = (
(0x02000000): = 'DT_RESPONSE'
)
(0x01000000):Fmt = (
(0x02000000): = 'TDS1'
)
)
(0x01000000):usr = (
(0x01000000):MessageId = (
(0x02000000): = '1234'
)
)
)
(0x01000000):MRM = (
(0x01000000):TRANS_HEADER = (
(0x03000000):USER_TYPE = '#1'
(0x03000000):PADDING = '0000001'
(0x03000000):SLOT_ID = '001'
)
(0x01000000):DT_BODY = (
(0x03000000):PADDING1 = '8'
(0x03000000):TIMESTAMP = '082206132231'
(0x03000000):PADDING2 = 'A'
)
)
)
But i'm not getting the data part in my output message. I'm getting the MQRFH2 values properly, but an empty data section.
Please let me know which other property has to be set in the message.
Last edited by vmurali_au on Wed Aug 23, 2006 5:55 am; edited 1 time in total |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Aug 22, 2006 9:34 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
It would be nice, but should not be required, for OutputRoot.Properties.Domain to be "MRM".
Did you create the MRM subtree with the correct parser associated with it? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
vmurali_au |
Posted: Tue Aug 22, 2006 9:39 am Post subject: |
|
|
 Voyager
Joined: 26 Mar 2004 Posts: 76
|
Thanks for response Jeff.
No. After setting the properties and mcd values, i created the MRM element using
outMessage.getRootElement().evaluateXPath("./?MRM");
I could have used the function createElementAsLastChild(parserName) for creating the MRM element, but i didnt know whether any prebuilt string parser name is available for MRM parser. I found the constant MbBLOB.PARSER_NAME for the BLOB parser, but nothing for MRM parser. Is there anything similar for MRM? |
|
Back to top |
|
 |
vmurali_au |
Posted: Tue Aug 22, 2006 10:50 am Post subject: |
|
|
 Voyager
Joined: 26 Mar 2004 Posts: 76
|
I've constructed the MRM body using createElementAsLastChild("MRM").
Now i'm getting the following output out of Java Compute Node
(
(0x01000000):Properties = (
(0x03000000):MessageSet = 'DC8LRAG002001'
(0x03000000):MessageType = 'DT_RESPONSE'
(0x03000000):MessageFormat = 'TDS1'
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Transactional = TRUE
(0x03000000):Persistence = FALSE
(0x03000000):CreationTime = GMTTIMESTAMP '2006-08-22 18:31:32.230'
(0x03000000):ExpirationTime = -1
(0x03000000):Priority = 0
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
(0x03000000):ReplyProtocol = 'MQ'
(0x03000000):Topic = NULL
(0x03000000):ContentType = ''
)
(0x01000000):MQMD = (
(0x03000000):SourceQueue = 'EMP_IN'
(0x03000000):Transactional = TRUE
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Format = 'MQHRF2 '
(0x03000000):Version = 2
(0x03000000):Report = 0
(0x03000000):MsgType = 8
(0x03000000):Expiry = -1
(0x03000000):Feedback = 0
(0x03000000):Priority = 0
(0x03000000):Persistence = 0
(0x03000000):MsgId = X'414d5120574d42202020202020202020cbfbea4420001c25'
(0x03000000):CorrelId = X'000000000000000000000000000000000000000000000000'
(0x03000000):BackoutCount = 0
(0x03000000):ReplyToQ = ' '
(0x03000000):ReplyToQMgr = 'WMB '
(0x03000000):UserIdentifier = 'mveeraiyan '
(0x03000000):AccountingToken = X'16010515000000ac6a360ee34a0a3e544c536e988e030000000000000000000b'
(0x03000000):ApplIdentityData = ' '
(0x03000000):PutApplType = 11
(0x03000000):PutApplName = '\Supportpac\ih03\rfhutil.exe'
(0x03000000):PutDate = DATE '2006-08-22'
(0x03000000):PutTime = GMTTIME '18:31:32.230'
(0x03000000):ApplOriginData = ' '
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000'
(0x03000000):MsgSeqNumber = 1
(0x03000000):Offset = 0
(0x03000000):MsgFlags = 0
(0x03000000):OriginalLength = -1
)
(0x01000000):MQRFH2 = (
(0x03000000):Version = 2
(0x03000000):Format = ' '
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Flags = 0
(0x03000000):NameValueCCSID = 1208
(0x01000000):mcd = (
(0x01000000):Msd = (
(0x02000000): = 'MRM'
)
(0x01000000):Set = (
(0x02000000): = 'DC8LRAG002001'
)
(0x01000000):Type = (
(0x02000000): = 'DT_RESPONSE'
)
(0x01000000):Fmt = (
(0x02000000): = 'TDS1'
)
)
(0x01000000):usr = (
(0x01000000):MessageId = (
(0x02000000): = '1234'
)
)
)
(0x01000021):MRM = (
(0x0300000B):TRANS_HEADER = NULL
(
(0x0300000B):USER_TYPE = '#1'
(0x0300000B):PADDING = '0000001'
(0x0300000B):USER_ID = '001'
)
(0x0300000B):DT_BODY = NULL
(
(0x0300000B):PADDING1 = '8'
(0x0300000B):TIMESTAMP = '082206143142'
(0x0300000B):PADDING2 = 'A'
)
)
)
But unfortuntely i'm getting following ParserException, TDS writing error in Output node.
'CheckedVector::error - vector index out of range.'
I've created the TDS message set using the following properties
MRM
= {All Elements Delimited; Delimiter = <CR><LF>}
TRANS_HEADER
= {All Elements Delimited; Delimiter = <SP>}
DT_BODY
= {Fixed Length; PADDING1 = 2, TIMESTAMP = 12, PADDING2 = 1} |
|
Back to top |
|
 |
vmurali_au |
Posted: Tue Aug 22, 2006 1:19 pm Post subject: |
|
|
 Voyager
Joined: 26 Mar 2004 Posts: 76
|
This is the code i'm using in my Java Compute Node for constructing TDS message
Code: |
MbMessage outMessage = new MbMessage();
MbMessageAssembly outAssembly = new MbMessageAssembly(contact admin,outMessage);
copyMessageHeaders(inMessage,outMessage);
outMessage.getRootElement().evaluateXPath("./?Properties/?MessageDomain[set-value('MRM')]");
outMessage.getRootElement().evaluateXPath("./?Properties/?MessageSet[set-value('DC8LRAG002001')]");
outMessage.getRootElement().evaluateXPath("./?Properties/?MessageType[set-value('DT_RESPONSE')]");
outMessage.getRootElement().evaluateXPath("./?Properties/?MessageFormat[set-value('TDS1')]");
MbElement e_mcd = outMessage.getRootElement().getFirstElementByPath("/MQRFH2/usr").createElementBefore(MbElement.TYPE_NAME,"mcd",null);
e_mcd.evaluateXPath("./?Msd[set-value('MRM')]");
e_mcd.evaluateXPath("./?Set[set-value('DC8LRAG002001')]");
e_mcd.evaluateXPath("./?Type[set-value('DT_RESPONSE')]");
e_mcd.evaluateXPath("./?Fmt[set-value('TDS1')]");
outMessage.getRootElement().createElementAsLastChild("MRM");
outMessage.evaluateXPath("/?TRANS_HEADER/?USER_TYPE[set-value('"+"#"+((String)((MbElement)HdrValues.get(0)).getValue())+"')]");
outMessage.evaluateXPath("/?TRANS_HEADER/?PADDING[set-value('"+((String)((MbElement)HdrValues.get(1)).getValue())+"')]");
outMessage.evaluateXPath("/?TRANS_HEADER/?USER_ID[set-value('"+((String)((MbElement)HdrValues.get(2)).getValue())+"')]");
outMessage.evaluateXPath("/?DT_BODY/?PADDING1[set-value('\u001B8')]");
outMessage.evaluateXPath("/?DT_BODY/?TIMESTAMP[set-value('"+new SimpleDateFormat("MMddyyHHmmss").format(new Date())+"')]");
outMessage.evaluateXPath("/?DT_BODY/?PADDING2[set-value('A')]");
outMessage.finalizeMessage(MbMessage.FINALIZE_VALIDATE); |
|
|
Back to top |
|
 |
kimbert |
Posted: Wed Aug 23, 2006 1:09 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
From the Java API docs for class MbElement:
Quote: |
When creating a new message from scratch, it is important that the parser-owning folders (elements whose parent is the root element) are created using only the following methods passing in the parser name as the argument:
* createElementAfter(parserName)
* createElementBefore(parserName)
* createElementAsLastChild(parserName)
* createElementAsFirstChild(parserName)
* createElementAsLastChildFromBitstream()
Children of these folders should be created with the other create methods only. |
So it was a good move to start using createElementAsLastChild().
The rest of your tree-building code uses XPath to build all the child nodes. That's an unusual style, and it might be the cause of the exception which you are getting. I suggest that you use the standard create...() methods in the Java API instead of using evaluateXPath(). You'll probably get better performance as well.
The 'CheckedVector::error' exception is definitely an internal error in the TDS writer. You could raise a PMR with IBM for that, but first you should try building the message tree differently. |
|
Back to top |
|
 |
vmurali_au |
Posted: Wed Aug 23, 2006 5:53 am Post subject: |
|
|
 Voyager
Joined: 26 Mar 2004 Posts: 76
|
Thanks a lot Jeff & Kim
Sorry, the reason for the TDS writing error i was getting was due to not adding the mxsd file to the message set project i was including in the bar file. Mistakenly while creating the mxsd file, i selected a different message set project and hence the project i was including in my bar file didnt have it. I couldnot check or verify it from the contents of bar file.
I'm wondering why the last statement "outMessage.finalizeMessage(FINALIZE_VALIDATE)" statement in my Java Compute node didnt throw error saying "message definition not found". Even the trace node after the java compute didnt throw any errors. I got some other creepy TDS writing error : "Vector index out of range" in the MQOutput node.
Thanks once again everyone. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Aug 23, 2006 1:50 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Glad it's working now. I still think your tree-building code looks bizarre, though! You probably have a good reason for using evaluateXPath() throughout, but I'd love to know what it is. |
|
Back to top |
|
 |
vmurali_au |
Posted: Thu Aug 24, 2006 9:36 am Post subject: |
|
|
 Voyager
Joined: 26 Mar 2004 Posts: 76
|
I'm using XPath just because it is easy and concise.
The only problem with XPath is we wont get the auto-completion facility while mapping of MRM elements as it is avaliable in ESQL compute node. So the probability of making mistakes are more.
But, I would like to know what are the performance implications of using XPath and not the DOM like createElement***() methods provided in java.
Does IBM has literature on the same? |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Aug 24, 2006 9:41 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I'd bet that the XPath syntax gets mapped onto the MbElement methods - so you're doing the same work with an added translation later on top.
Maybe MGK will comment more specifically.
I'm not aware of any particular documentation on the performance of XPath vs the other methods. But I vaguely remember something in the Performance report support packs - I think one of the test cases was using XPath at least to access data. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Aug 24, 2006 3:17 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
There was a compare done in the latest user group meeting. Check out http://www.nynjmq.org.
However it does not seem that the material is available on the web site. You might have to contact the organizers...
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kimbert |
Posted: Fri Aug 25, 2006 3:31 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I asked the developer of the broker's XPath engine. He says:
What he is doing is perfectly valid. We added the extra axis to our XPath implementation to allow trees to be built like this. It's a matter of taste as to whether you use this or the create...() methods. It's not true that the XPath steps map onto MbElement methods, the XPath engine is implemented in C++ on top of the ImbSyntaxElement tree and a complete XPath expression will be evaluated with one JNI crossing. Performance depends purely on the complexity of the expression.
Sorry for suggesting that your approach was unusual. Carry on as you were! |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Aug 25, 2006 4:06 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I guess I lost the bet.  _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|