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 » What should MQI app put some JMS app will read?

Post new topic  Reply to topic
 What should MQI app put some JMS app will read? « View previous topic :: View next topic » 
Author Message
bmccarty
PostPosted: Thu Jan 09, 2003 4:19 pm    Post subject: What should MQI app put some JMS app will read? Reply with quote

Apprentice

Joined: 18 Dec 2001
Posts: 43

Could someone please clarify what needs to be done so that a MQI application can put a message so that a JMS app will be able to read it. I assume that we would need to include the RFH2 header according to the mapping section of the Using Java manual. However, most of the examples assume you are putting from JMS and getting from MQI. That's easy enough because you can change the target client to "MQ". However, I don't know what the fields and types should look like to include to build the RFH2 header from MQI.

If someone as a sample, that would be great. We are putting from an MVS Cobol application, but any examples would be appreciated.

Thanks,

B
Back to top
View user's profile Send private message AIM Address MSN Messenger
kingdon
PostPosted: Thu Jan 09, 2003 11:34 pm    Post subject: Reply with quote

Acolyte

Joined: 14 Jan 2002
Posts: 63
Location: UK

You don't need to do anything to send from an MQI application to a JMS one, the JMS layer handles the mapping automatically. If the MQI message is sent with the format field set to MQFMT_STRING then JMS will receive it as a JMSTextMessage with appropriate codepage conversion. Anything else will be received as a JMSBytesMessage, so the application will have to know about the content.

You only need to construct an RFH2 from an MQI application if you want to go beyond the basic mapping described above, for example to send user properties.

Cheers,
James.
Back to top
View user's profile Send private message
bmccarty
PostPosted: Fri Jan 10, 2003 1:20 pm    Post subject: Geting the whole JMS list when reading MQMD message Reply with quote

Apprentice

Joined: 18 Dec 2001
Posts: 43

My snippet is now able to remove the MQMD message as a JMS get; however it returns the all of the JMS stuff. What do I need to change to just get the payload at the bottom into a String()? Little confused:

Message inMessage = queueReceiver.receiveNoWait();
System.out.println(inMessage);

It looks like this:

JMS Message class: jms_text
JMSType: null
JMSDeliveryMode: 1
JMSExpiration: 0
JMSPriority: 0
JMSMessageID: ID:c3e2d840d4d8e3c24040404040404040b8c2c03e040e2223
JMSTimestamp: 1041356615970
JMSCorrelationID:null
JMSDestination: null
JMSReplyTo: null
JMSRedelivered: false
JMS_IBM_PutDate:20021231
JMSXAppID:DataFlowEngine
JMS_IBM_Format:MQSTR
JMS_IBM_PutApplType:6
JMS_IBM_MsgType:8
JMSXUserID:mqsiuser
JMS_IBM_PutTime:17433597
JMSXDeliveryCount:1
<RECORD><FIRSTNAME>SUSIE</FIRSTNAME><LASTNAME>QUEUE</LASTNAME></RECORD>
Back to top
View user's profile Send private message AIM Address MSN Messenger
bower5932
PostPosted: Mon Jan 13, 2003 6:20 am    Post subject: Reply with quote

Jedi Knight

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

You need to cast your Message into the appropriate type of Message (ie, BytesMessage, TextMessage, MapMessage, ObjectMessage, StreamMessage) and then use the appropriate method to get at the message data. For example, in a TextMessage, you would use:

((TextMessage)inMessage).getText()
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
bmccarty
PostPosted: Mon Jan 13, 2003 12:50 pm    Post subject: Reply with quote

Apprentice

Joined: 18 Dec 2001
Posts: 43

duuhh

Thanks for the pointer RB. I think I am loosing my mind. It all works fine after the cast.

B
Back to top
View user's profile Send private message AIM Address MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » What should MQI app put some JMS app will read?
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.