Author |
Message
|
hareshp |
Posted: Wed Feb 18, 2009 12:27 pm Post subject: Help Needed - Java JMS Queue. Not Receiving COD. |
|
|
Newbie
Joined: 18 Feb 2009 Posts: 5
|
We are using JMS API.
We are able to successfully send out a message, but we are not receiving a COD.
- The outgoing Queue is set to "Q.SETT.SCRAP" for testing.
- The reply to queue is "Q.SETT.IN.COD".
- The Queue Manager is "CBX2GSS2.GWY.U" which is a local queue manager.
We have also tried this with a remote queue manager and we are not getting a COD.
What are we missing/doing incorrectly that we do not see a COD. Thanks in advance for the assistance.
we are using the following method to send the message:
Code: |
org.springframework.jms.core.JmsTemplate.send(queue, mqMsg);
|
The value of queue (using an XML Marshaller):
Code: |
<com.ibm.mq.jms.MQQueue>
<baseQueueName>Q.SETT.SCRAP</baseQueueName>
<baseQueueManagerName>CBX2GSS2.GWY.U</baseQueueManagerName>
<version>6</version>
<expiry>-2</expiry>
<priority>-2</priority>
<persistence>-2</persistence>
<CCSID>1208</CCSID>
<targetClient>1</targetClient>
<encoding>273</encoding>
<failIfQuiesce>1</failIfQuiesce>
</com.ibm.mq.jms.MQQueue>
|
The value of mqMsg (the message text was shorted to "MESSAGE" for readability):
Code: |
<com.itp.gt.queue.MQTextMessage>
<message class="string">MESSAGE</message>
<replyTo class="com.ibm.mq.jms.MQQueue">
<baseQueueName>Q.SETT.IN.COD</baseQueueName>
<baseQueueManagerName>CBX2GSS2.GWY.U</baseQueueManagerName>
<cachedQueueName>queue://CBX2GSS2.GWY.U/Q.SETT.IN.COD?targetClient=1</cachedQueueName>
<cachedNVs>targetClient=1</cachedNVs>
<version>6</version>
<expiry>-2</expiry>
<priority>-2</priority>
<persistence>-2</persistence>
<CCSID>1208</CCSID>
<targetClient>1</targetClient>
<encoding>273</encoding>
<failIfQuiesce>1</failIfQuiesce>
<cachedDNVs>targetClient=1</cachedDNVs>
<cachedUNVs></cachedUNVs>
</replyTo>
</com.itp.gt.queue.MQTextMessage>
|
The MessageCreator we are using:
Code: |
public class MQTextMessage implements MessageCreator
{
private Object message;
public Object getMessage() { return message; }
public void setMessage(Object foo) { message = foo; }
private Destination replyTo;
public MQTextMessage(String message, Destination replyTo)
{
this.message = message;
this.replyTo = replyTo;
}
public Message createMessage(Session session) throws JMSException
{
Message jmsMessage = session.createTextMessage(message.toString());
if(replyTo != null){ jmsMessage.setJMSReplyTo(replyTo); }
/* The value of jmsMessage is listed below */
return jmsMessage;
}
}
|
The value of jmsMessage in the MessageCreator:
Code: |
<com.ibm.jms.JMSTextMessage serialization="custom">
<com.ibm.jms.JMSMessage>
<default>
<cachedCcsid>0</cachedCcsid>
<ccsidForStrings>0</ccsidForStrings>
<ccsidForStringsIsAscii>false</ccsidForStringsIsAscii>
<deliveryMode>2</deliveryMode>
<expiration>0</expiration>
<gotByConsume>false</gotByConsume>
<hideDeliveryMode>false</hideDeliveryMode>
<isNullMessage>false</isNullMessage>
<priority>4</priority>
<propertiesReadOnly>false</propertiesReadOnly>
<redelivered>false</redelivered>
<stringsNeedCcsidConversion>false</stringsNeedCcsidConversion>
<timeToLive>0</timeToLive>
<timestamp>0</timestamp>
<jmsStringResourcesClassName>com.ibm.mq.jms.MQJMSStringResources</jmsStringResourcesClassName>
<messageClass>jms_text</messageClass>
<properties/>
<replyTo class="com.ibm.mq.jms.MQQueue">
<baseQueueName>Q.SETT.IN.COD</baseQueueName>
<baseQueueManagerName>CBX2GSS2.GWY.U</baseQueueManagerName>
<cachedQueueName>queue://CBX2GSS2.GWY.U/Q.SETT.IN.COD?targetClient=1</cachedQueueName>
<cachedNVs>targetClient=1</cachedNVs>
<version>6</version>
<expiry>-2</expiry>
<priority>-2</priority>
<persistence>-2</persistence>
<CCSID>1208</CCSID>
<targetClient>1</targetClient>
<encoding>273</encoding>
<failIfQuiesce>1</failIfQuiesce>
<cachedDNVs>targetClient=1</cachedDNVs>
<cachedUNVs></cachedUNVs>
</replyTo>
</default>
</com.ibm.jms.JMSMessage>
<com.ibm.jms.JMSTextMessage>
<default>
<dataStart>0</dataStart>
<readOnly>false</readOnly>
<messageText>MESSAGE</messageText>
</default>
</com.ibm.jms.JMSTextMessage>
</com.ibm.jms.JMSTextMessage>
|
Please let me know if you need more information. Thanks.
Last edited by hareshp on Wed Feb 18, 2009 12:47 pm; edited 1 time in total |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Feb 18, 2009 12:34 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
First you need to determine if the message you are putting has the necessary options to ask MQ to generate a COD.
Only after that is configured can you troubleshoot the rest of the MQ network to make sure that any CODs can be delievered to your ReplyToQueue. |
|
Back to top |
|
 |
hareshp |
Posted: Wed Feb 18, 2009 12:51 pm Post subject: |
|
|
Newbie
Joined: 18 Feb 2009 Posts: 5
|
mqjeff wrote: |
First you need to determine if the message you are putting has the necessary options to ask MQ to generate a COD.
Only after that is configured can you troubleshoot the rest of the MQ network to make sure that any CODs can be delievered to your ReplyToQueue. |
Hi mqjeff. Thanks for the quick reply. How do i go about determining if the message has the necessary options to ask MQ to generate a COD. My original post contains the contents of the message. We are using JMS API. Thanks. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Feb 18, 2009 12:57 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You need to look at the message after it is written to the queue.
And review the documentation on how a COD is requested. |
|
Back to top |
|
 |
hareshp |
Posted: Wed Feb 18, 2009 1:03 pm Post subject: |
|
|
Newbie
Joined: 18 Feb 2009 Posts: 5
|
Can anyone else help me with more specifics like what in the message i need to look for. A link to the manual where COD requests are specified could help. If anyone has had success with COD and JMS please let me know what else i need to do. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Wed Feb 18, 2009 1:22 pm Post subject: Re: Help Needed - Java JMS Queue. Not Receiving COD. |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi,
Unless I'm blind, I don't see where you set the Report Option.
hareshp wrote: |
Code: |
public class MQTextMessage implements MessageCreator
{
private Object message;
public Object getMessage() { return message; }
public void setMessage(Object foo) { message = foo; }
private Destination replyTo;
public MQTextMessage(String message, Destination replyTo)
{
this.message = message;
this.replyTo = replyTo;
}
public Message createMessage(Session session) throws JMSException
{
Message jmsMessage = session.createTextMessage(message.toString());
if(replyTo != null){ jmsMessage.setJMSReplyTo(replyTo); }
/* The value of jmsMessage is listed below */
return jmsMessage;
}
} |
|
If you want to use an option, you should set the appropriate flag. Try setting the COD report option in your code:
Code: |
jmsMessage.setIntProperty("JMS_IBM_Report_COD",
MQC.MQRO_COD_WITH_DATA); |
Of course, next you will need to know how to identify a COD message from a non-COD message. Time to RTM.
Regards,
Roger Lacroix _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
hareshp |
Posted: Wed Feb 18, 2009 1:30 pm Post subject: |
|
|
Newbie
Joined: 18 Feb 2009 Posts: 5
|
Thanks Roger, I'll give this a shot.
We have specific queues just for COD. This way we don't have to identify which ones are COD and which aren't.
But if it ever comes to needing to differenciate, I will have to RTM .
By any chance, do you have a link to the manual which would help me get a list of the possible properties i can set. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Feb 18, 2009 1:38 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
hareshp wrote: |
Thanks Roger, I'll give this a shot.
We have specific queues just for COD. This way we don't have to identify which ones are COD and which aren't.
But if it ever comes to needing to differenciate, I will have to RTM .
By any chance, do you have a link to the manual which would help me get a list of the possible properties i can set. |
All manuals are in the infocenter (link at top of page).
Read the using Java manual and specifically the way to map the JMS properties to the RFH and MQMD headers and vice versa... Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
hareshp |
Posted: Wed Feb 25, 2009 8:11 am Post subject: Setting User ID on JMSMessage |
|
|
Newbie
Joined: 18 Feb 2009 Posts: 5
|
Code: |
jmsMessage.setIntProperty("JMS_IBM_Report_COD",
MQC.MQRO_COD_WITH_DATA);
|
After setting the property above, the couterparty is seeing the COD message in their Dead Letter Queue. It seems that the reason for this behavior is an incorrect userId in the JMSMessage we send. The counterparty is expecting a specific user, but are seeing the default mqm user in our messages.
In our old implementation, we were able to set the userId directly for the MQMessage (userId is a public variable in MQMessage). For the JMSMessage object, this class variable does not exist.
Does anyone know how to set the userId in a JMSMessage?
In the documentation, I was unable to locate the possible properties for the other property setters for the JMSMessage class (setLongProperty, setObjectProperty, setShortProperty, setStringProperty). |
|
Back to top |
|
 |
RogerLacroix |
Posted: Wed Feb 25, 2009 1:21 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi,
Code: |
conn = cf.createConnection("myUser",null); |
In JMS, you cannot set the UserID of an individual message. If you want to do this, then you need to write a Java Send Exit.
Regards,
Roger Lacroix _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
|