Author |
Message
|
adrian_ |
Posted: Sun Apr 08, 2012 8:30 am Post subject: MQOutput generating new message id problem |
|
|
Novice
Joined: 06 Jan 2012 Posts: 13
|
hi ,i have a flow where i use a MQOutput node, with generate new message ID.
My problem is that MQOutput node generate same id every time,
so in destination queue i have all messages with the same id.
This is issue is known ?
Is there any solutions for this (using MQOutput node, i don't want to generate the id outside the mqoutput node)? |
|
Back to top |
|
 |
mapa |
Posted: Sun Apr 08, 2012 8:46 am Post subject: |
|
|
 Master
Joined: 09 Aug 2001 Posts: 257 Location: Malmö, Sweden
|
version and platform is?
And what does your flow do?
Just so you don't send tests with same id and then just pass it along... |
|
Back to top |
|
 |
mqsiuser |
Posted: Sun Apr 08, 2012 8:56 am Post subject: Re: MQOutput generating new message id problem |
|
|
 Yatiri
Joined: 15 Apr 2008 Posts: 637 Location: Germany
|
Is it the same as the input msg id ?
Have you changed "pass all" to "set all" (on the output node):
Code: |
Advanced -> "Message context" = "Pass All" --> "Set All" |
There actually also is a "programmatic" way to set the msg-id:
Code: |
SET OutputRoot.MQMD.MsgId = MQPMO_NEW_MSG_ID; -- new msg id
SET OutputRoot.MQMD.MsgId = MQMI_NONE; -- no MsgID (probably not a good idea in many cases) |
...but... I think you should do it on the output-node ! _________________ Just use REFERENCEs |
|
Back to top |
|
 |
zpat |
Posted: Sun Apr 08, 2012 10:22 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Clearing the msgid field each time is the key to getting unique ones generated. |
|
Back to top |
|
 |
mqsiuser |
Posted: Mon Apr 09, 2012 12:08 am Post subject: |
|
|
 Yatiri
Joined: 15 Apr 2008 Posts: 637 Location: Germany
|
zpat wrote: |
Clearing the msgid field each time is the key to getting unique ones generated. |
Code: |
SET OutputRoot.MQMD.MsgId = MQMI_NONE; |
When I did this, this just lead to an empty MsgId on the output-msg and was the reason for me to create an account here and ask my first question on this forum. But well... the reason why I tried this must have been what zpat says... good luck with all that input ... I made it work with just the output-node (and the 2 settings there) afaicr. _________________ Just use REFERENCEs |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Apr 09, 2012 7:29 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
On the MQOutput node inspect the properties and check create new messageId. Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
zpat |
Posted: Mon Apr 09, 2012 11:23 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Well, I didn't code the WMB node obviously - but I am giving standard MQ programming advice, as in the IBM manual.
Quote: |
For the MQPUT and MQPUT1 calls, if MQMI_NONE or MQPMO_NEW_MSG_ID is specified by the application, the queue manager generates a unique message identifier when the message is put, and places it in the message descriptor sent with the message. The queue manager also returns this message identifier in the message descriptor belonging to the sending application. The application can use this value to record information about particular messages, and to respond to queries from other parts of the application. The sending application can also specify a value for the message identifier other than MQMI_NONE; this stops the queue manager generating a unique message identifier. An application that is forwarding a message can use this to propagate the message identifier of the original message. |
|
|
Back to top |
|
 |
mqsiuser |
Posted: Mon Apr 09, 2012 11:45 pm Post subject: |
|
|
 Yatiri
Joined: 15 Apr 2008 Posts: 637 Location: Germany
|
zpat wrote: |
Well, I didn't code the WMB node obviously - but I am giving standard MQ programming advice, as in the IBM manual. |
Probably I had use this:
Quote: |
SET OutputRoot.MQMD.MsgId = ''; |
or this:
Quote: |
SET OutputRoot.MQMD.MsgId = NULL; |
And then got into trouble... so ...
Dear, OP... since you brought it up here ... (and you also got provided some valuable input ) would you mind... to test both approaches and let us know.
That would be awesome (and quite clarifying).
Probably there are different "EMTIES", otherwise (with what zpat wrote) the msgId could never have been empty (and my problem and that of other people(?) would/could have never occured ). _________________ Just use REFERENCEs |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Apr 10, 2012 8:38 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
mqsiuser wrote: |
Probably I had use this:
Code: |
SET OutputRoot.MQMD.MsgId = ''; |
or this:
Code: |
SET OutputRoot.MQMD.MsgId = NULL; |
And then got into trouble... so ... |
Well we already know this won't work.
The right code would have been
Code: |
SET OutputRoot.MQMD.MsgId = MQMI_NONE; |
as clearly stated by zpat.
The field is of type BLOB and length 24 bytes. So a blank string won't do it and a null value, the way you assigned it, would remove the field from the MQMD record... Don't know how the parser would interpret that... probably choke on it and throw an exception...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|