Author |
Message
|
DeadHead |
Posted: Thu Sep 28, 2006 11:36 am Post subject: Reading MQ... |
|
|
 Novice
Joined: 28 Sep 2006 Posts: 12
|
New at MQ & Java. I have a Java MQ Client app that is running on an ISeries/AS400 that is reading from the MQ Server which is located on another ISeries/AS400 box. All it has to do is read the MQ message and write it out to a DDM DataQ that exists on the ISeries/AS400. When I copy/paste a test message using MQ Explorer to the MQQueue, my app reads it just fine and writes it to the DataQ on the ISeries. When I try to read a message that is sent to me from the Java/JMS 3rd party software, MQ is attaching a header to each message and NOTHING gets written. It does drop off the MQQueue though. This app is being written to deal with these messages coming from the 3rd party software. Is their a way to strip this header info off or even send an MQ message without header info? Any help or ideas would be very appreciated.. Thanks in advance.  _________________ "One man gathers what another man spills" GD |
|
Back to top |
|
 |
special_agent_Queue |
Posted: Thu Sep 28, 2006 11:48 am Post subject: |
|
|
 Centurion
Joined: 27 Jul 2006 Posts: 102
|
All messages traveling through MQ must have at least a MQMD header. |
|
Back to top |
|
 |
DeadHead |
Posted: Thu Sep 28, 2006 11:51 am Post subject: |
|
|
 Novice
Joined: 28 Sep 2006 Posts: 12
|
special_agent_Queue wrote: |
All messages traveling through MQ must have at least a MQMD header. |
Is there any slick way of stripping this off and just dealing with the data message in order to write it out?  _________________ "One man gathers what another man spills" GD |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Sep 28, 2006 12:26 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
All messages passing through WebSphere MQ must have an MQMD on them.
All WebSphere MQ APIs give you a simple means to access the message data without having to access the MQMD or deal with the MQMD.
JMS messages using the WebSphere MQ JMS Provider tend to have an MQRFH2 header attached to them, that will be in the first part of the message body.
If your message body starts with MQHRF, then this is your problem.
You can ask nicely if the sending application will change their Queue Destination definition to set Target Client to MQ, instead of having it set to JMS. This will cause the MQRFH2 header not to be included.
You can read the Using Java manual and the Application Programming Guide/Reference to find out how to strip an MQRFH2 header by hand, if the sender won't specify Target Client. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
DeadHead |
Posted: Thu Sep 28, 2006 1:42 pm Post subject: |
|
|
 Novice
Joined: 28 Sep 2006 Posts: 12
|
Thanks jefflowrey for the insight... It cleared up some...shall we say...confusion... You can bet I'll be checking the manual as you suggested too. This is a great site wih a lot of experience hanging around. Thanks again. _________________ "One man gathers what another man spills" GD |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Sep 28, 2006 2:38 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You can also write your application in JMS and thus let JMS deal with the JMS header.
The JMS API will allow you direct access to the message content whether there is a JMS header or not...
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|