ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Message format from a JMS application

Post new topic  Reply to topic
 Message format from a JMS application « View previous topic :: View next topic » 
Author Message
rrohra
PostPosted: Fri Nov 12, 2010 8:16 am    Post subject: Message format from a JMS application Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Fri Nov 12, 2010 10:45 am    Post subject: Re: Message format from a JMS application Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Fri Nov 12, 2010 12:13 pm    Post subject: Re: Message format from a JMS application Reply with quote

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
View user's profile Send private message Send e-mail
rrohra
PostPosted: Tue Nov 16, 2010 6:23 am    Post subject: Solved my moving to base MQ for other reasons. Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Tue Nov 16, 2010 6:53 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Nov 16, 2010 9:04 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Message format from a JMS application
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.