|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Destination list and java plugin node |
« View previous topic :: View next topic » |
Author |
Message
|
Mateo |
Posted: Tue Apr 29, 2003 4:59 am Post subject: Destination list and java plugin node |
|
|
Novice
Joined: 21 Aug 2002 Posts: 24
|
Hi,
I have MQInput1 -> Compute1 -> MQOutput1
In Compute1 I have:
Code: |
SET OutputRoot = InputRoot;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
SET OutputLocalEnvironment.Destination.MQDestinationList.DestinationData[1].queueManagerName = 'EAI.BROKER';
SET OutputLocalEnvironment.Destination.MQDestinationList.DestinationData[2].queueManagerName = 'EAI.BROKER';
SET OutputLocalEnvironment.Destination.MQDestinationList.DestinationData[1].queueName = 'OUT1';
SET OutputLocalEnvironment.Destination.MQDestinationList.DestinationData[2].queueName = 'OUT2';
|
Thats working fine - i got messages in OUT1, OUT2
Than I replace Compute1 with my jplugin node (MultiplicatorNode) in which produces the same OutputLocalEnvironment tree.
I compare OutputLocalEnvironment using TraceNode placed after Compute1/MultiplicatorNode.
But with MultiplicatorNode I got error on propagate method:
Code: |
<com.ibm.broker.plugin.MbBrokerException source:WMQIv210 key:2230 message:[WMQIv210:2230]BIP2230E: Error detected whilst processing a message in node '{0}'.
The message broker detected an error whilst processing a message in node '{0}'. An exception has been thrown to cut short the processing of the message.
See the following messages for details of the error. : Caught exception and rethrowing >
at com.ibm.broker.plugin.MbOutputTerminal._propagate(Native Method)
at com.ibm.broker.plugin.MbOutputTerminal.propagate(MbOutputTerminal.java:126)
at multiplicator.MultiplicatorNode.evaluate(MultiplicatorNode.java:145)
|
When I disable destinationList functionality in MQOutput1 setting (for example) as queue manager EAI.BROKER and as queue OUT1 I got message propaged.
Can anybody help me ?
Mateo |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Apr 29, 2003 5:28 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Can we see your Java code that creates the destination list? |
|
Back to top |
|
 |
Mateo |
Posted: Tue Apr 29, 2003 5:45 am Post subject: |
|
|
Novice
Joined: 21 Aug 2002 Posts: 24
|
Actualy java code is simpler , does nothing with OUT2 queue, but it is not a siginficant difference to the problem I have (I think):
Code: |
public void evaluate(MbMessageAssembly assembly, MbInputTerminal in)
throws MbException {
MbMessage newLocalEnv = new MbMessage(assembly.getLocalEnvironment());
MbMessageAssembly newAssembly = new MbMessageAssembly(assembly,
newLocalEnv,
assembly.getGlobalEnvironment(),
assembly.getExceptionList(),
new MbMessage(assembly.getMessage()));
// create paths: Variables.MQDestinationList.DestinationData.queueManagerName
// Variables.MQDestinationList.DestinationData.queueName
MbElement curElement = newAssembly.getLocalEnvironment().getRootElement();
MbElement varElement = curElement.getFirstElementByPath("/Variables");
if (varElement == null)
curElement = curElement.createElementAsFirstChild( MbElement.TYPE_NAME, "Variables", null );
else
curElement = varElement;
curElement = curElement.createElementAsFirstChild( MbElement.TYPE_NAME, "MQDestinationList", null );
curElement = curElement.createElementAsFirstChild( MbElement.TYPE_NAME, "DestinationData", null );
curElement.createElementAsFirstChild( MbElement.TYPE_NAME, "queueName", "OUT1" );
curElement.createElementAsFirstChild( MbElement.TYPE_NAME, "queueManagerName", "EAI.BROKER" );
MbOutputTerminal out = getOutputTerminal("out");
if(out != null)
out.propagate(newAssembly);
}
|
|
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Apr 29, 2003 5:58 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Well, if this is really the code you're using, the problem is clear.
You are creating the equivalent of OutputLocalEnvironment.Variables.MQDestinationList.DestinationData.queueName, instead of OutputLocalEnvironment.Destination.MQDestinationList.DestinationData.queueName.
Also, you may be creating a NameValue element when you need to create a Name element with a Value child. I ended up doing
Code: |
tnElem = tnRootElem.createElementAsFirstChild(MbElement.TYPE_NAME);
tnElem.setName("TrackingNumber");
MbElement tnElemVal = tnElem.createElementAsFirstChild(MbElement.TYPE_VALUE);
tnElemVal.setValue(trkNum); |
in one of my java nodes. Yes, it could be simplified by consolidating the set call into the createElement call. But hopefully the point is clear. |
|
Back to top |
|
 |
Mateo |
Posted: Tue Apr 29, 2003 6:15 am Post subject: |
|
|
Novice
Joined: 21 Aug 2002 Posts: 24
|
Jeff You were right. I've checked also with both OUT1,OUT2 queues and it works well.
Thanks for Your help.
Mateo |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Apr 29, 2003 6:26 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Out of curiosity, which was I right about? 'Variables' or Name/Value?
I'm not setting destination lists inside java nodes, but I can see some use for doing it, so it'd be nice to know. |
|
Back to top |
|
 |
Mateo |
Posted: Tue Apr 29, 2003 6:37 am Post subject: |
|
|
Novice
Joined: 21 Aug 2002 Posts: 24
|
'Variables' was wrong. I did not tried Name/Value .
Generaly I use plugin nodes to read data from db and cache it in memory so I query database only for the first message (than use cache). In this case the data from db tells how shoud I set destination list.
Mateo |
|
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
|
|
|
|