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 » Sample to send Message to NON_JMS receiver

Post new topic  Reply to topic
 Sample to send Message to NON_JMS receiver « View previous topic :: View next topic » 
Author Message
WBI_user
PostPosted: Fri Feb 07, 2003 6:40 am    Post subject: Sample to send Message to NON_JMS receiver Reply with quote

Partisan

Joined: 07 Aug 2001
Posts: 386

I have written a JMS program to put a message on a queue. The message consummer is non_JMS. The message put out by my JMS program has a RFH2 header in the queue. I need to remove that.
According to the MQ using JAVA manual, it says that I can set TargetClient to JMSC.MQJMS_CLIENT_NONJMS_MQ and the RFH2 header will not be there. However there is sample on how to do it. I also need to make sure that the format field in MQMD is MQ_STR so that data conversion between platform can happen. I am not sure if the set TargetClient will set the format also.

I am new to MQ JMS.
The code that I am using to put a message to MYQUEUE is:

ioQueue = session.createQueue( "MYQUEUE" );
QueueSender queueSender = session.createSender(ioQueue);
TextMessage outMessage = session.createTextMessage();
outMessage.setText("my message");
queueSender.send(outMessage);

Can some one show me how I can do it in my code. I am not using JNDI.
Back to top
View user's profile Send private message
bower5932
PostPosted: Fri Feb 07, 2003 7:10 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

Try something like:
Code:

ioQueue = session.createQueue( "MYQUEUE" );
((MQQueue)ioQueue).setTargetClient(1);
QueueSender queueSender = session.createSender(ioQueue);

Of course, this will make your JMS code MQ specific. You'd be better off looking up the object and adding the TC(MQ) parameter to your object.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
WBI_user
PostPosted: Fri Feb 07, 2003 7:54 am    Post subject: Reply with quote

Partisan

Joined: 07 Aug 2001
Posts: 386

It works . Thanks a lot for the quick response. One thing I noticed is that the message now has a CCSID of 1208 where as it was 819 beofre I add the line of code that you suggested. Any explanation ?
Back to top
View user's profile Send private message
yaakovd
PostPosted: Sat Feb 08, 2003 10:45 am    Post subject: Reply with quote

Partisan

Joined: 20 Jan 2003
Posts: 319
Location: Israel

You removed RFH2 which contains CCSID.
Outgoing message (TextMessage or BytesMessage) is encoded in the character set given by the Destination object. This defaults to UTF-8 (1208) encoding.

Check CCSID on your destination QMgr.
_________________
Best regards.
Yaakov
SWG, IBM Commerce, Israel
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 » Sample to send Message to NON_JMS receiver
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.