I am encountering an issue when sending the message in this following manner. I am sending the message using CICS via JMS. I receive the error "Unable to put message to reply queue" with an MQRC=2110 error code on the mainframe side, and I also receive a null response. Can you help me resolve this issues.
Version : IBM MQ 9.1 I am sending the code like this...
Hashtable<String, String> environment = new Hashtable<String, String>();
environment.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory");
// Setup JNDI context
Context context = new InitialContext(environment);
// Look up connection factory and destination queue
ConnectionFactory connectionFactory = (ConnectionFactory) context
.lookup("jms/xyz");
// creating request Queue
Destination requestQueue = (Destination) context
.lookup(requestQueueName);
Connection connection = connectionFactory.createConnection();
Session session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
logger.info("getJMSConnection:: JMS connections created ...");
You didn't follow any tips I gave you in the other post on the same subject. There is a lot wrong with your code so I decided to play around with my own code because I was bored today.
I don't think you are understanding how MQ handles the chaining of embedded structures:
This sets the CCSID of the MQMD header:
Whereas this sets the CCSID of the first embedded structure:
Next, why are you setting the MQMD UserId field? There is really no purpose to it.
And your setting of the MQMD format field is not correct.
Finally, is the message payload or any of the structures going to be in EBCDIC? If not, then do NOT attempt to set the CCSID, because it will just break or generate an error.
Here is a fully functioning JMS application that puts a CICS message to a queue.
Here is a HEX dump of the message sent from my code showing the 2 embedded structures:
The message's MQMD Format field is shown here:
And the MQRFH2 header, JMS properties and the correctly set CICS format is shown here:
Now, I don't currently have a CICS region to test your actual formatting CICS header and message payload. But if its not correct, just refer to the MQCIH structure in the cmqc.h file.
Or you could just use the MQCIH class from the MQ Java base classes.