Author |
Message
|
wisemind |
Posted: Tue Aug 31, 2010 8:54 am Post subject: Can we put different msgs on diff. queues via Java Compute?? |
|
|
Apprentice
Joined: 16 Jun 2010 Posts: 29
|
Hello ,
I am using Message Broker V 6.1.0.3. I want to put different messages in different queues using Java Compute Node. The thing i want is to execute messages on same time with different output nodes of java compute Node.
thanks. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Aug 31, 2010 8:57 am Post subject: Re: Can we put different msgs on diff. queues via Java Compu |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
wisemind wrote: |
I want to put different messages in different queues using Java Compute Node. |
That's as easy as doing it with an ESQL Compute node if you use the facilities of WMB. The better question is why you want to put messages directly to a queue from inside a JCN rather than using WMB, with all the extra trouble this will cause. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Aug 31, 2010 9:09 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
What does it mean "execute messages on same time"? |
|
Back to top |
|
 |
wisemind |
Posted: Tue Aug 31, 2010 9:17 am Post subject: |
|
|
Apprentice
Joined: 16 Jun 2010 Posts: 29
|
Thanks for your quick response!
Well i am unable to understand what do you mean by use the facilities of WMB?? I am using WebSphere Message Broker. Inside this i am using Java Compute Node that generate XML messages from the incoming txt File. Actually I have different Components that reads the message from different queues. And Queues messages should be generated from the java compute Node.
The thing i want is to send xml messages to 2 different queues . Can you tell me how can i do this??
Well execute messages on same time means , i want to put the messages at the same time as generated JCN.
Thanks |
|
Back to top |
|
 |
Vitor |
Posted: Tue Aug 31, 2010 9:17 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
What does it mean "execute messages on same time"? |
I was going to get to that later. Having established why the messages were being put from within the JCN, then we'd move to the difficulties of running a UoW outside WMB's control (thereby executing the messages at the same time by committing them simultaniously). _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Aug 31, 2010 9:19 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
wisemind wrote: |
The thing i want is to send xml messages to 2 different queues . Can you tell me how can i do this?? |
Use 2 MQOutput nodes or 1 MQOutput node with a destination list.
wisemind wrote: |
Well execute messages on same time means , i want to put the messages at the same time as generated JCN. |
What makes you think this wouldn't happen? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
wisemind |
Posted: Tue Aug 31, 2010 9:27 am Post subject: |
|
|
Apprentice
Joined: 16 Jun 2010 Posts: 29
|
So how can we describe inside the JCN that, In which MQ Node you have to put what message???
I am using the following way in JCN.
MbMessage outMessage = new MbMessage(inMessage);
MbElement elements= null;
outMessage = new MbMessage();
try {
MbMessageAssembly outAssembly = new MbMessageAssembly(contact admin,outMessage);
outMessage.getRootElement().createElementAsLastChild("XMLNSC");
MbElement pro = outMessage.getRootElement().getFirstChild();
MbElement pro1 = pro.getFirstChild();
pro1.getNextSibling().getNextSibling().setValue("XML1");
elements = outMessage.getRootElement().createElementAsLastChild(MbXMLNS.PARSER_NAME);
elements = elements.createElementAsFirstChild(MbElement.TYPE_NAME, "in:GetData", null);
elements.createElementAsFirstChild(MbXMLNS.ASIS_ELEMENT_CONTENT, null, "");
elements.createElementAsLastChild(MbXMLNS.ATTRIBUTE, "xmlns:in", "http://abc/abc");
elements = elements.createElementAsFirstChild(MbXMLNS.ELEMENT, "ProcessInput", null);
elements = elements.createElementAsFirstChild(MbXMLNS.ELEMENT, "MSISDN", "a");
MbElement outRoot = outMessage.getRootElement();
MbElement mqmd = outRoot.getFirstChild().createElementAfter("MQHMD");
mqmd.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE,"Format","");
outMessage.finalizeMessage(MbMessage.FINALIZE_NONE);
out.propagate(outAssembly);
////
Thanks. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Aug 31, 2010 9:54 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
This is basic use of the product.
Look at the Message Routing Sample.
Go back to the training materials you received during the class you took on using message broker - or go back to the more senior person you are working with who is getting paid to provide you with mentoring and training.
We're not a training resource. |
|
Back to top |
|
 |
wisemind |
Posted: Tue Aug 31, 2010 10:01 am Post subject: |
|
|
Apprentice
Joined: 16 Jun 2010 Posts: 29
|
I have already seen that sample. But thats describe the ESQL Node not JCN.
Well Cant you provide me a link where i can write messages to multiple queue in JCN?? |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Aug 31, 2010 10:22 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Which part, exactly, are you confused about?
- How to configure an MQOutput node to use a queue name from the message tree, rather than from a node property
- How to propagate a message to different output terminals of a JavaCompute node
- How to populate different portions of the logical message tree using the Java API for Message Broker
- how to connect different terminals to different MQOutput nodes
- How many output terminals are available on a JavaCompute node
?
But if you want one link to answer all of those questions, it is this one. |
|
Back to top |
|
 |
wisemind |
Posted: Tue Aug 31, 2010 11:02 am Post subject: |
|
|
Apprentice
Joined: 16 Jun 2010 Posts: 29
|
Well this is what i want using Java Compute Node.
how to connect different terminals to different MQOutput nodes. |
|
Back to top |
|
 |
wisemind |
Posted: Tue Aug 31, 2010 11:07 am Post subject: |
|
|
Apprentice
Joined: 16 Jun 2010 Posts: 29
|
Lets suppose i have create these two messages.
MbMessage outMessage = new MbMessage(inMessage);
MbMessageAssembly outAssembly = new MbMessageAssembly(contact admin, outMessage);
...
newMsg.finalizeMessage(MbMessage.FINALIZE_NONE);
out.propagate(outAssembly);
...
newMsg.finalizeMessage(MbMessage.FINALIZE_NONE);
out.propagate(outAssembly);
Now my question is how to propogate messages at different MQNodes that is attached to this JCN???? |
|
Back to top |
|
 |
wisemind |
Posted: Tue Aug 31, 2010 11:30 am Post subject: |
|
|
Apprentice
Joined: 16 Jun 2010 Posts: 29
|
I ALSO tried to find out this point that you told me before but unable to know how to do this in Java Compute Node...
How to configure an MQOutput node to use a queue name from the message tree, rather than from a node property
Thanks |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Aug 31, 2010 11:33 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
it seems you read most of this link, in that you appear to have copy/pasted code, but you do not seem to have read all of this page. |
|
Back to top |
|
 |
wisemind |
Posted: Tue Aug 31, 2010 11:37 am Post subject: |
|
|
Apprentice
Joined: 16 Jun 2010 Posts: 29
|
I read this page. The thing i want to send messages to different queue. I dont want to use alternative terminal. I want to use the output terminal. That points to 2 different MQNodes.
The thing i want to propagate message firstly to first MQNode. And next message to 2nd MQNode. So how to set values of the particular MQNode in JavaCompute Node.
I hope you got my point.
thanks |
|
Back to top |
|
 |
|