|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
sample java code to post to MQ in CICS format |
« View previous topic :: View next topic » |
Author |
Message
|
santosh_pastay |
Posted: Fri Dec 18, 2009 1:24 am Post subject: sample java code to post to MQ in CICS format |
|
|
Newbie
Joined: 18 Dec 2009 Posts: 1
|
Hi there,
Is there any working sample of how to post a MQCICS message to MQ queue using java and spring?
I have set the following properties
public BytesMessage createMessage(Session session) {
BytesMessage byteMsg = null;
BigInteger bi = new BigInteger(stringMessage, 16);
byte[] theByteArray = bi.toByteArray();
try {
byteMsg = session.createBytesMessage();
byteMsg.writeBytes(theByteArray);
byteMsg.setIntProperty("JMS_IBM_MsgType", 1);
byteMsg.setStringProperty("JMS_IBM_Format",
MQC.MQFMT_CICS);
byteMsg.setIntProperty("JMS_IBM_Encoding", 785);
byteMsg.setStringProperty("JMS_IBM_Character_Set",
"37");
byteMsg.setIntProperty("JMS_IBM_PutApplType", 11);
byteMsg.setJMSPriority(0);
// byteMsg.setJMSMessageID(byteMsg.getJMSMessageID());
// byteMsg.setJMSTimestamp(byteMsg.getJMSTimestamp());
byteMsg.setJMSReplyTo(respDestination);
byteMsg.setJMSCorrelationIDAsBytes(MQC.MQCI_NEW_SESSION);
but the message is going in MQRFH2 format.
Please help.
-Santosh |
|
Back to top |
|
 |
Vitor |
Posted: Fri Dec 18, 2009 5:52 am Post subject: Re: sample java code to post to MQ in CICS format |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
santosh_pastay wrote: |
but the message is going in MQRFH2 format.
|
The RFH2 header (it's not a format, despite the name of the field) is a function of using JMS; it's where WMQ stores the JMS header attributes. If you don't want it, suppress it within JMS.
There have been a number of discussions in here regarding this; I'd imagine it's the same with Java inside CICS but have no direct experience of this. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 18, 2009 2:55 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Set the targetClient Property of the Destination to 1 in Spring.
I would strongly suggest that you set that property to "MQ" in your Destination JNDI.
Have fun :innocent. _________________ MQ & Broker admin |
|
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
|
|
|
|