|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
What should MQI app put some JMS app will read? |
« View previous topic :: View next topic » |
Author |
Message
|
bmccarty |
Posted: Thu Jan 09, 2003 4:19 pm Post subject: What should MQI app put some JMS app will read? |
|
|
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 |
|
 |
kingdon |
Posted: Thu Jan 09, 2003 11:34 pm Post subject: |
|
|
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 |
|
 |
bmccarty |
Posted: Fri Jan 10, 2003 1:20 pm Post subject: Geting the whole JMS list when reading MQMD message |
|
|
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 |
|
 |
bower5932 |
Posted: Mon Jan 13, 2003 6:20 am Post subject: |
|
|
 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 |
|
 |
bmccarty |
Posted: Mon Jan 13, 2003 12:50 pm Post subject: |
|
|
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 |
|
 |
|
|
 |
|
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
|
|
|
|