|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Creating a custom processing node |
« View previous topic :: View next topic » |
Author |
Message
|
rcrippen |
Posted: Thu Jun 24, 2004 7:14 am Post subject: Creating a custom processing node |
|
|
Apprentice
Joined: 01 Aug 2002 Posts: 45 Location: Rochester, NY
|
I'm creating a solution using a Custom Java plugin processing node and have a question concerning passing new message content out the out terminal of the node.
I'm receiving XML formated data into the custom node, performing a set of actions (HTTPS request/response) and then I need to send a new XML document out of the 'out' terminal to be processed by built-in nodes.
The issue that I have is that I can't seem to properly create a new message inside the evaluate method. I can add a new child to the original message, but I can't see how to add a new body to the message. I tried to use the createElementFromLastChildFromBitstream method of the MbElement class, but when I ran the message flow, I got an internal error on the broker and the broker shuts down.
I'm going to continue to research this in the IBM redbooks, but can anyone provide some help in where to look for an explanation of how to create a new message in a custom processing node.
Thanks for any assistance,
Rob Crippen |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jun 24, 2004 7:19 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Have you done
Code: |
MbMessage newMsg = new MbMessage(assembly.getMessage());
MbMessageAssembly newAssembly = new MbMessageAssembly(assembly, newMsg);
|
There's a section in the Help for the tooling called "Developing User-defined extensions" in the "Developing Applications" chapter. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
rcrippen |
Posted: Thu Jun 24, 2004 9:48 am Post subject: |
|
|
Apprentice
Joined: 01 Aug 2002 Posts: 45 Location: Rochester, NY
|
Jeff,
yes, I have looked through that as well as the pdf on app development for custom node creation. Here is the source that I'm trying to implement as well as the event log entries associated with the execution:
source inside evaluate method:
MbMessage newMsg = new MbMessage(assembly.getMessage());
MbMessageAssembly newAssembly = new MbMessageAssembl(assembly, newMsg);
MbElement rootElement = newAssembly.getMessage().getRootElement();
MbElement XMLElement = rootElement.getLastChild().getFirstChild();
XMLElement.detach();
XMLElement = rootElement.createElementAsLastChildFromBitstream(newDataString.getBytes(), "XML", null, null, null, 0, 0, 0);
MbOutputTerminal out = getOutputTerminal("Out");
out.propagate(newAssembly);
event log entry 1:
( LTROCX01.default ) Broker process terminating abnormally: The following diagnostic information will be required when contacting IBM: '
Severe Abend Error detected.
For full details see Abend File: C:/Program Files/IBM/WebSphere Business Integration Message Brokers/errors/LTROCX01.default.3768.1112.Abend
A summary of the Error follows:
An Unhandled Exception detected in process 3768, on thread 0x458.
Type: EXCEPTION_ACCESS_VIOLATION (C0000005).
Address: 001B:01AA1B8A.
The thread could not read from memory address 0x00000008.
'.
A broker process is terminating abnormally.
Contact your IBM support center.
event log entry 2:
( LTROCX01.default ) Unable to open queue 'SYSTEM.BROKER.INTER.BROKER.COMMUNICATIONS' on WebSphere Business Integration queue manager 'LTROCX01': completion code 2; reason code 2042.
A message flow node failed to open the indicated WebSphere Business Integration message queue. The error codes relate to the MQOPEN call.
Check the WebSphere Business Integration completion and reason codes in the WebSphere Business Integration Application Programming Reference manual to establish the cause of the error, taking any appropriate action. It may be necessary to restart the message broker after you have performed this recovery action. If the open failed because the queue manager or queue did not exist, define these objects to WebSphere Business Integration. If the failure of the open was because incorrect object names were specified, correct the message flow configuration and attempt to redeploy the message broker.
I'll keep trying to get this to work. If anyone sees anything obvious, please let me know.
Thanks,
Rob Crippen |
|
Back to top |
|
 |
rcrippen |
Posted: Thu Jul 08, 2004 4:08 am Post subject: |
|
|
Apprentice
Joined: 01 Aug 2002 Posts: 45 Location: Rochester, NY
|
Again, persistence pays off....I knew that the createElementAsLastChildFromBitstream method WAS the one I needed to use to create a new output message. The one thing I did wrong was putting the nulls in the parameter list of the method. Once I put "", everything worked perfectly.
Here is the method call that worked:
XMLElement = rootElement.createElementAsLastChildFromBitstream(newDataString.getBytes(), "XML", "", "", "", 0, 0, 0);
Just wanted to close this thread.
Thanks for everyone's help.
Rob |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|