|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Sample to send Message to NON_JMS receiver |
« View previous topic :: View next topic » |
Author |
Message
|
WBI_user |
Posted: Fri Feb 07, 2003 6:40 am Post subject: Sample to send Message to NON_JMS receiver |
|
|
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 |
|
 |
bower5932 |
Posted: Fri Feb 07, 2003 7:10 am Post subject: |
|
|
 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 |
|
 |
WBI_user |
Posted: Fri Feb 07, 2003 7:54 am Post subject: |
|
|
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 |
|
 |
yaakovd |
Posted: Sat Feb 08, 2003 10:45 am Post subject: |
|
|
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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|