Author |
Message
|
rickffields |
Posted: Mon Sep 22, 2008 12:58 pm Post subject: Multiple Message Types in single queue. |
|
|
Newbie
Joined: 22 Sep 2008 Posts: 1
|
We would like to send multiple messages to a single queue. It would be from a mainframe application to a webMethods server. We would like to use the MQ Headers to determine the message type. Can we use the MSGID and CORRELATION ID's on the PUT and have the get program pull all messages and route them accordingly. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Sep 22, 2008 2:46 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Bad design.
MessageId and CorrelationId should be set by MQ and used in an anonymous identifier pattern. They should not contain any hidden business meaning!
Go back to the drawing board. If you need to set up content that way use the RFH header.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
gbaddeley |
Posted: Mon Sep 22, 2008 7:23 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
You can use CorrelId (24 bytes of binary data) for this purpose, but if you store text (EBCDIC) in that field on the mainframe, it will not be converted when WebMethods (ASCII Unix?) gets the message.
You can use the MessageType field of the MQMD, as this is an integer that has a reserved range for application specific purposes.
You can also add an RFH header to the data, or use Properties in MQ V7, but this is adding to the message data payload, which the ultimate receiving application may not be able to handle. _________________ Glenn |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Sep 22, 2008 7:58 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
gbaddeley wrote: |
You can also add an RFH header to the data, or use Properties in MQ V7, but this is adding to the message data payload, which the ultimate receiving application may not be able to handle. |
As per the original post:
rickffields wrote: |
from a mainframe application to a webMethods server |
I would have thought the webMethods server to be a J2EE environment and as such there should be no problem reading the RFH header / message Properties.
What you end up writing is a dispatcher application that retrieves the MQ message and routes it to the correct consumer depending on the message type.... Message brokers do this very well...(content based routing) however not without a cost...($$$).
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
RogerLacroix |
Posted: Thu Sep 25, 2008 8:11 am Post subject: Re: Multiple Message Types in single queue. |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
rickffields wrote: |
We would like to send multiple messages to a single queue. It would be from a mainframe application to a webMethods server. We would like to use the MQ Headers to determine the message type. Can we use the MSGID and CORRELATION ID's on the PUT and have the get program pull all messages and route them accordingly. |
I perfer to have a queue per "application function". Do not use MsgId field. Also, I would not use the CorrelID as it is not converted between platforms (EBCDIC to ASCII).
I would use MQMD's ApplIdentityData field. Here's a snippet from the WMQ APR manual:
IBM wrote: |
ApplIdentityData is information that is defined by the application suite, and can be used to provide additional information about the message or its originator. The queue manager treats this information as character data, but does not define the format of it. When the queue manager generates this information, it is entirely blank. |
The nice thing about the ApplIdentityData field is it WILL be converted between different platforms.
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
omhopper |
Posted: Thu Sep 25, 2008 12:54 pm Post subject: |
|
|
Novice
Joined: 08 Jun 2007 Posts: 17
|
Is there a way to set the ApplIdentityData using a JMS program though? I can't find that referenced in the Using Java manual section for header mapping?
EDIT -- Never mind. A quick search on this site shows that it's not possible. It's too bad that between JMSType (for JMS) and ApplIdentityData (when using MQ libs) can't work together to allow for routing based on header data. _________________ Thanks. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Thu Sep 25, 2008 1:47 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
omhopper wrote: |
Is there a way to set the ApplIdentityData using a JMS program though? |
No. You have to write an MQ send or receive exit in Java to handle this issue.
I've done it. I've got pieces to another product but their doesn't seem to be any interest.
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
|