Author |
Message
|
jwende |
Posted: Fri Jan 21, 2005 5:52 am Post subject: ESQL: difference between copy of complete tree .... |
|
|
 Novice
Joined: 02 Jul 2001 Posts: 23
|
I'm currentrly struggling with a simple copy of the complete message tree vs copying all element trees.
My original message comes from a java plugin (input node) and if my next compute node uses the simple statement:
call CopyEntireMessage();
the output node is note able to write the bitstream into the output queue .
If I copy all elements using:
DECLARE I INTEGER 1;
DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
WHILE I <= J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
everything works fine.
Any suggestions.
Regards,
Joerg |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jan 21, 2005 5:54 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Maybe you are not creating your MbElements properly?
What does a trace node with a pattern of ${Root} show, when inserted between your plug-in and your output node? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jwende |
Posted: Fri Jan 21, 2005 6:28 am Post subject: |
|
|
 Novice
Joined: 02 Jul 2001 Posts: 23
|
Input Trace (before compute node):
(
(0x01000000):Properties = (
(0x03000000):MessageSet = NULL
(0x03000000):MessageType = NULL
(0x03000000):MessageFormat = NULL
(0x03000000):Encoding = NULL
(0x03000000):CodedCharSetId = NULL
(0x03000000):Transactional = NULL
(0x03000000):Persistence = NULL
(0x03000000):CreationTime = NULL
(0x03000000):ExpirationTime = NULL
(0x03000000):Priority = NULL
(0x03000000):ReplyIdentifier = NULL
(0x03000000):ReplyProtocol = 'MQ'
(0x03000000):Topic = NULL
)
(0x01000000):MQMD = (
(0x03000000):StrucID = 'MD'
(0x03000000):Version = 2
(0x03000000):Format = 'MQSTR'
)
(0x01000000):BLOB = (
(0x03000000):BLOB = X'466c6f775469636b6572'
)
)
Output Trace (after compute node):
(
(0x01000000):Properties = (
(0x03000000):MessageSet = NULL
(0x03000000):MessageType = NULL
(0x03000000):MessageFormat = NULL
(0x03000000):Encoding = NULL
(0x03000000):CodedCharSetId = NULL
(0x03000000):Transactional = UNKNOWN
(0x03000000):Persistence = UNKNOWN
(0x03000000):CreationTime = NULL
(0x03000000):ExpirationTime = NULL
(0x03000000):Priority = NULL
(0x03000000):ReplyIdentifier = NULL
(0x03000000):ReplyProtocol = 'MQ'
(0x03000000):Topic = NULL
)
(0x01000000):MQMD = (
(0x03000000):StrucID = 'MD'
(0x03000000):Version = 2
(0x03000000):Format = 'MQSTR'
(0x03000000):CorrelId = NULL
)
(0x01000000):BLOB = (
(0x03000000):BLOB = X'466c6f775469636b6572'
)
)
I changed the java code to produce the MQMD.CorrelId element as well but it didn't help. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jan 21, 2005 7:46 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If your java node is only producing blob data, then I suspect that the problem is that you are not creating a complete MQMD.
I would have your java node create a complete MQMD filled in with default values. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jwende |
Posted: Sun Jan 23, 2005 9:38 am Post subject: |
|
|
 Novice
Joined: 02 Jul 2001 Posts: 23
|
I create following MQMD fields:
StrucId = 'MD'
Version = 2
Format = 'MQSTR'
These are the same fields I'm required to create if I want to create a MQMD header using ESQL.
I'm still astonished about the different behaviour of ESQL:
If I use SET OutputRoot = InputRoot the output message is not valid, but if I use
DECLARE I INTEGER 1;
DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
WHILE I <= J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
the output message is created successfully. |
|
Back to top |
|
 |
kirani |
Posted: Sun Jan 23, 2005 3:50 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Shouldn't your MQMD header be complete after your input node?
What is your CSD level? _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
shra_k |
Posted: Mon Jan 24, 2005 3:40 am Post subject: |
|
|
Apprentice
Joined: 30 Dec 2002 Posts: 37
|
i believe your java node is an input node.
If yes , you have two options...
Option 1) create your MQMD header as the way IA97 support pac does.
(http://www-1.ibm.com/support/docview.wss?rs=203&uid=swg24007299&loc=en_US&cs=utf-8&lang=en)
Option 2) Construct a MbMessage object as a copy of the one returned from createMessage and use this new copy to build MQMD or message tree in the plugin input node.
It should solve your prolem |
|
Back to top |
|
 |
jwende |
Posted: Mon Jan 24, 2005 4:49 am Post subject: |
|
|
 Novice
Joined: 02 Jul 2001 Posts: 23
|
Thank you.
I'll take a look ...
Joerg |
|
Back to top |
|
 |
jwende |
Posted: Fri Jan 28, 2005 9:37 am Post subject: |
|
|
 Novice
Joined: 02 Jul 2001 Posts: 23
|
Problem solved !!!
The main problem was that after calling the createMessage() method you can do everything with your messagetree but unfortunately the broker doesn't change your original message.
If your plugin is now directly connected to an output node, the parser(serializing component) doesn't work with the messagetree - it takes directly the original bitstream.
The new code looks like this:
public int run(MbMessageAssembly assembly) throws MbException {
try {
// put in your input node logic
}
} // catch (MQException e)
catch (Exception e) {
}
// generate MQMD with default values based on supportpack IA97
byte[] dataMQMD;
dataMQMD = _utils.generateMQMD();
// generate new bytestream to add your application data and append this to dataMQMD
byte[] data;
// put in your logic to append data to dataMQMD
// create message from bytestream
MbMessage myOutMsg = createMessage(data);
myOutMsg.finalizeMessage(MbMessage.FINALIZE_VALIDATE);
MbMessageAssembly outAssembly = new MbMessageAssembly(assembly, myOutMsg);
dispatchThread();
getOutputTerminal("out").propagate(outAssembly);
//return SUCCESS_RETURN;
return SUCCESS_CONTINUE;
}
Thank you for the pointer to IA97 .....
And if you set the format field of MQMD to 'XML' the parser will recognise this! |
|
Back to top |
|
 |
shra_k |
Posted: Wed Feb 02, 2005 10:12 pm Post subject: |
|
|
Apprentice
Joined: 30 Dec 2002 Posts: 37
|
Am the author of IA97 supportpac and am going to upgrade it with more features soon. The initial version was meant for beginers to understand how to write a java plugin input node.  |
|
Back to top |
|
 |
jwende |
Posted: Thu Feb 03, 2005 1:28 am Post subject: |
|
|
 Novice
Joined: 02 Jul 2001 Posts: 23
|
Thanks - I thank you reached the target  |
|
Back to top |
|
 |
|