Author |
Message
|
Gama |
Posted: Wed Apr 30, 2008 8:36 am Post subject: MQGet problem WMB6 |
|
|
 Centurion
Joined: 11 Jan 2005 Posts: 103 Location: Portugal
|
Hello all,
I need to all messages from Q1 to one message on Q2, i think with the best way is using the node MQGet.
MQInput->MQGet->Compute->MQOutput.
I'm using the XMLNS format.
MQInput queue is Q1
MQGet queue is Q2
MQOutput queue is Q3
After the node MQGet the message return XML Parsing Errors have occurred. Was supposed to return the message that is in Q2 insn't it?
Any suggestions are welcome.
Best regards
Gama |
|
Back to top |
|
 |
madi |
Posted: Wed Apr 30, 2008 10:43 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
Quote: |
After the node MQGet the message return XML Parsing Errors have occurred. Was supposed to return the message that is in Q2 insn't it?
|
it is and saying that the XML in Q2 is faulty!!
--madi _________________ IBM Certified Solutions Developer - WMB 6.0 |
|
Back to top |
|
 |
Gama |
Posted: Wed Apr 30, 2008 11:06 am Post subject: |
|
|
 Centurion
Joined: 11 Jan 2005 Posts: 103 Location: Portugal
|
Quote: |
it is and saying that the XML in Q2 is faulty!! |
Hi madi,
The messages on Q2 are:
Msg1<SAFT-PT>
<CTRL_PROCESS>
<ELEMENT_NAME>aaa</ELEMENT_NAME>
</CTRL_PROCESS>
<ELEMENT_VALUE/>
</SAFT-PT>
Msg1<SAFT-PT>
<CTRL_PROCESS>
<ELEMENT_NAME>bbb</ELEMENT_NAME>
</CTRL_PROCESS>
<ELEMENT_VALUE/>
</SAFT-PT>
Msg1<SAFT-PT>
<CTRL_PROCESS>
<ELEMENT_NAME>ccc</ELEMENT_NAME>
</CTRL_PROCESS>
<ELEMENT_VALUE/>
</SAFT-PT>
What are the problems with the messages?
Thanks. |
|
Back to top |
|
 |
JosephGramig |
Posted: Wed Apr 30, 2008 11:51 am Post subject: |
|
|
 Grand Master
Joined: 09 Feb 2006 Posts: 1244 Location: Gold Coast of Florida, USA
|
Then end tags:
</CTRL_PROCESS>
<ELEMENT_VALUE/>
Are in the incorrect order (I would guess).
As in, them messages ain't well formed. _________________ Joseph
Administrator - IBM WebSphere MQ (WMQ) V6.0, IBM WebSphere Message Broker (WMB) V6.1 & V6.0
Solution Designer - WMQ V6.0
Solution Developer - WMB V6.1 & V6.0, WMQ V5.3 |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Apr 30, 2008 12:02 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
JosephGramig wrote: |
Then end tags:
<ELEMENT_VALUE/> |
That's not an end tag, that's an empty element... _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
JosephGramig |
Posted: Wed Apr 30, 2008 12:28 pm Post subject: |
|
|
 Grand Master
Joined: 09 Feb 2006 Posts: 1244 Location: Gold Coast of Florida, USA
|
My bad
That'll teach me to look closer.
First, you should use XMLNSC unless you have a specific reason to use XMLNS. Next, once you resolve your parser issue. You will likely only get the first message that matches what you told it to match.
I have a similar flow to collect all messages matching on correlID. I loop collecting messages in Environment until MQGet times out. Then I mash the msgs into the new msg and put it. |
|
Back to top |
|
 |
Gama |
Posted: Wed Apr 30, 2008 2:29 pm Post subject: |
|
|
 Centurion
Joined: 11 Jan 2005 Posts: 103 Location: Portugal
|
Quote: |
First, you should use XMLNSC unless you have a specific reason to use XMLNS. Next, once you resolve your parser issue. You will likely only get the first message that matches what you told it to match.
I have a similar flow to collect all messages matching on correlID. I loop collecting messages in Environment until MQGet times out. Then I mash the msgs into the new msg and put it. |
On both nodes MQInput and MQGet use XMLNSC.
So, can you give-me some example?
Thanks |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 30, 2008 11:55 pm Post subject: Re: MQGet problem WMB6 |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Gama wrote: |
I need to all messages from Q1 to one message on Q2, i think with the best way is using the node MQGet.
MQInput->MQGet->Compute->MQOutput.
I'm using the XMLNS format.
MQInput queue is Q1
MQGet queue is Q2
MQOutput queue is Q3
|
IMHO this is the wrong way round. If Q2 has the singleton message which 1-n messages on Q1 relate to, then the input node should read the singleton, then the MQGet node should use this information to extract the matching messages from Q1. You'll need to include a loop of some kind as JosephGramig points out and either store them or process them according to your design. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
JosephGramig |
Posted: Thu May 01, 2008 4:32 am Post subject: |
|
|
 Grand Master
Joined: 09 Feb 2006 Posts: 1244 Location: Gold Coast of Florida, USA
|
The input queue is the queue with the first msg (to get the correlID).
The get queue is the queue with correlated msgs.
The loop drains the "get" queue until it times out due to reading all msgs.
Code: |
MQInput.out->MQGet.out->MsgMashCompute.out->
(back to)MQGet.NoMessage->MQOutput
|
MQInput properties are just XMLNSC
MQGet properties.basic.queue name="some.q"
MQGet properties.Input Msg Parser=XMLNSC
MQGet properties.Request.=Get by correlID (checked)
MQGet properties.Result.Output data location=InputLocalEnvironment.MyStuff
Now, what happens is that the first msg passes through as is and then "get" msg is put into the InputLocalEnvironment at MyStuff. Now that I look back at my code, the first msg is passing through because I copied it. So, you should now mash the "get" msg into the main msg and output that (I was collecting BLOBs to build a MIME msg). Once it comes out due to reading all msgs, you will have your consolidated msg.
If you are using 6.1, you could try playing around with the Collector node to see if you can say get all msgs with the same correlID off one queue within say 10 seconds. It will fire up a separate thread for each different correlID in process. Of course, how would you know what to set the correlID to for the first msgs...
Now that I stop and almost think about it, you can use both queues and just produce a collection on the other side
And now I will recode my example using the collector node (when I have time). |
|
Back to top |
|
 |
Vitor |
Posted: Thu May 01, 2008 4:36 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
JosephGramig wrote: |
The input queue is the queue with the first msg (to get the correlID).
The get queue is the queue with correlated msgs.
The loop drains the "get" queue until it times out due to reading all msgs.
|
If I didn't say that, I meant to _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu May 01, 2008 5:01 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
JosephGramig wrote: |
Now that I stop and almost think about it, you can use both queues and just produce a collection on the other side  |
And if you think about it a bit more, you can use message grouping or a few other techniques to eliminate the need for the "trigger" message, and just use one MQInput -> Collector.
This is left as an exercise for the reader.
Also note that Gama is using MB v6 and not v6.1. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Gama |
Posted: Thu May 01, 2008 9:28 am Post subject: |
|
|
 Centurion
Joined: 11 Jan 2005 Posts: 103 Location: Portugal
|
Thaks JosephGramig, Vitor and efflowrey for your's answeres, but in Portugal todays is Holliday, tomorow i wil try your's suggestions.
You are the greatest
Thaks,
Gama |
|
Back to top |
|
 |
|