Author |
Message
|
rrohra |
Posted: Fri Nov 12, 2010 8:16 am Post subject: Message format from a JMS application |
|
|
Newbie
Joined: 12 Nov 2010 Posts: 2
|
I am trying to set the "MQSTR" message format from a pure JMS application. I am only using javax.jms.* interfaces in WebLogic implementation. I have tried various settings but none have given me a result to set the correct value for the payload to be interpreted as a text message. I am creating a text message on my end and integrating with a remote MQ. Any pointers would be appreciated.
Ravi |
|
Back to top |
|
 |
Vitor |
Posted: Fri Nov 12, 2010 10:45 am Post subject: Re: Message format from a JMS application |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
rrohra wrote: |
I am trying to set the "MQSTR" message format from a pure JMS application. |
Set where? It shouldn't be in the MQMD for a JMS application.
rrohra wrote: |
I have tried various settings but none have given me a result to set the correct value for the payload to be interpreted as a text message. |
So what happens when you just put a text message? What do you get?
rrohra wrote: |
I am creating a text message on my end and integrating with a remote MQ. |
No you're not. You're interogating it with an application connected to a remote MQ. What kind of application? Is it JMS aware or not (like a C application). If so, have you reviewed previous threads in this forum regarding sending JMS messages to non-JMS application & applied the advice? If it is JMS aware, what errors result when it reads the message? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Nov 12, 2010 12:13 pm Post subject: Re: Message format from a JMS application |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
rrohra wrote: |
I am creating a text message on my end and integrating with a remote MQ. Any pointers would be appreciated.
Ravi |
The question here is: are you creating a message with text content or are you creating a TextMessage? (javax.jms.TextMessage)...
This should be sufficient to set the format automatically.
As Vitor said, there are ways to suppress the RFH header in the destination JNDI... or using the right code in the URI.
We need more details and some code.
As well please describe the problem.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
rrohra |
Posted: Tue Nov 16, 2010 6:23 am Post subject: Solved my moving to base MQ for other reasons. |
|
|
Newbie
Joined: 12 Nov 2010 Posts: 2
|
Thank you for your responses. I do realize that not enough details are posted, but I seem to be past this problem since I am no longer using JMS to talk to a remote MQ. I am being told it is a Native MQ so I am switching to Base MQ implementation to send messages. The primary decision was to use ApplIdentityData and ApplOriginData properties which I found in other forums stating that it can only be set in MQ classes and not through JMS. Thank you for your help. |
|
Back to top |
|
 |
zpat |
Posted: Tue Nov 16, 2010 6:53 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
I recommend sending non-JMS messages for maximum compatibility with disparate systems. Using MQHRF2 (or RFH2) headers means that only JMS compatible applications can process the message. I would recommend using MQSTR throughout (MQFMT_STRING).
This is the Java JMS code to "turn off" RFH2 headers. You can set this in properties files but it's safer to code it (IMHO).
q.setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ) ; |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Nov 16, 2010 9:04 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
zpat wrote: |
I recommend sending non-JMS messages for maximum compatibility with disparate systems. Using MQHRF2 (or RFH2) headers means that only JMS compatible applications can process the message. I would recommend using MQSTR throughout (MQFMT_STRING).
This is the Java JMS code to "turn off" RFH2 headers. You can set this in properties files but it's safer to code it (IMHO).
q.setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ) ; |
I very seldom code it that way. I either set it in the JNDI for the destination or use the URI form to create the destination:
Code: |
String mydest = "queue://MYQMGR/MYQ?targetClient=1";
Queue myqueue = mymqsess.createQueue(mydest); |
Of course the destination String can be read from property files...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|