Author |
Message
|
MA |
Posted: Thu Jun 01, 2006 10:30 am Post subject: MQJava - Message Headers - Destination Queue - Help |
|
|
Newbie
Joined: 08 Mar 2005 Posts: 6
|
All:
For a trading partner - based on message type the message needs to be delivered to approximatly 50 different queue. I am looking for a soultion that I don't have to created 50 different adaptors and keep pooling for incoming message . What I like to do is - write one message dispatcher (MQJava client) which going populate an MQ Header ( for example destination Queue). On the other side - a generic router ( could be perl or shell script) keep on pooling this one queue. And based on the value in the - Destination Queue - it going to dispatch. Is there way in MQJava that I can populate custom headers?.
Is this do-able? Any othe alternative. I am using the MQJava and the MQSeries doesn't have JMS support at this moment?. Any suggestion , alternative plz.,
Thanks in advance
MA |
|
Back to top |
|
 |
vennela |
Posted: Thu Jun 01, 2006 11:30 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
I think you are looking for distribution lists |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jun 01, 2006 11:51 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I think you want to use an MQRFH2 header.
I don't think you want to use a destination list.
But here's the thing. If your first program knows the name of the queue that needs to be written to, you can just OPEN that queue and PUT the message there.
You don't need to put another queue or another process in between. Even if you do put another queue and another process in between, that other process has to OPEN that destination queue and PUT that message. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Jun 01, 2006 11:58 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
Couldn't you also look into doing something with publish and subscribe to get the single message routed to all interested parties? |
|
Back to top |
|
 |
MA |
Posted: Sun Jun 04, 2006 7:45 pm Post subject: MQJava - Message Headers - Destination Queue - Help |
|
|
Newbie
Joined: 08 Mar 2005 Posts: 6
|
Thanks a lot.
Subsequent queest - if the posted data to MQ queue needed to be written to a file in specified location. Is there any way that I can pass the "path/location @ which the file should be written". in MQ Headers.
If so any sample - to show - how to put and get the MQ Headers. I am using MQJava no JMS support available .
Thanks a lot in advance.
MA |
|
Back to top |
|
 |
jefflowrey |
Posted: Sun Jun 04, 2006 8:14 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The structure of the MQMD header is fully documented in the manual called "Application Programming Reference". In fact, that manual fully documents all of the predefined MQ headers.
There is no field in the MQMD that is really suitable for any application level data - like who a message belongs to or how it should be handled.
The MQRFH2 header, which is the MQ Rules and Formatting Header (version 2), has a place to put whatever application level data you want to add. It's called the "usr" folder.
Also, there is nothing that prevents you from adding your own custom header. You can do this by sticking the data at the front of the message body, separated from the rest of the message body by a blank line. Or some other piece of data if you want.
Please spend some more time thinking about what you want to do, and some more time reading the manuals. This "second" question of yours is really the same question. You'll notice I gave the same answer - use an MQRFH2!
Also, as a side note. If you have installed any of the MQ java classes, you have also installed all the classes you need to use JMS instead of the plain MQ API. So you can use JMS - and doing so is probably easier than writing Java code to read and write the MQRFH2 header properly. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
MA |
Posted: Sun Jun 04, 2006 8:34 pm Post subject: |
|
|
Newbie
Joined: 08 Mar 2005 Posts: 6
|
Thanks a bunch Jefflowrey for invaluable information. Yes I do have the JMS library installed and I am using it to interact with another - Sonic MQ. But I have been told the MQ Series on the other end is not capable of JMS intereaction. And I do not know of any way to check(or what change to make to add JMS capability to the server) if the MQ Server is infact does not support JMS.
I greatly appreciate your expertise - to help me explore this option.
Thanks
MA |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Jun 05, 2006 2:34 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
MA wrote: |
Thanks a bunch Jefflowrey for invaluable information. Yes I do have the JMS library installed and I am using it to interact with another - Sonic MQ. But I have been told the MQ Series on the other end is not capable of JMS intereaction. And I do not know of any way to check(or what change to make to add JMS capability to the server) if the MQ Server is infact does not support JMS.
I greatly appreciate your expertise - to help me explore this option.
Thanks
MA |
With version 5.3 MQ is JMS capable out of the box. You just have to use /install the jars that come delivered in <mqinstall>/java/lib.
Read the using java manual.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Jun 05, 2006 5:08 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
But if the other side doesn't support JMS, then that probably means that it can't read an MQRFH2 header.
So you need to ask the other side where they want the information, like the file name, that is needed.
Or if they are supposed to be supplying that information to you, then you should tell them to put it at the front of the message in a structured way with a known delimiter - like a blank line or something. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|