Author |
Message
|
mqmaniac |
Posted: Wed Jul 09, 2008 5:51 am Post subject: JMS question |
|
|
 Master
Joined: 27 Dec 2005 Posts: 201
|
I am using the Following code snippet
static String QUEUE_NAME =null;
static String QUEUE_MANAGER=null;
QUEUE="SENDER";
QMGR="SENDER_QUEUEMANAGER";
msg.setJMSReplyTo("queue://QMGR/QUEUE");
msg.setStringProperty("StringTag1", "Tag1Value1");
I am not sure on how to SET a property to NOT to SEND the RFH Header as the recieving end is a .NET Application.
Can someone tell me
a.)Are the MQMD.replytoQueue and MQMD.replytoqueuemanager automatically set from the URI when i send it to queue??
b.)How can the clinet read the Property (StringTag1) ??
Thanks in advance!!! |
|
Back to top |
|
 |
sridhsri |
Posted: Wed Jul 09, 2008 6:40 am Post subject: |
|
|
Master
Joined: 19 Jun 2008 Posts: 297
|
As far as I understand, you can use the setString and other set properties only with MQFRH2 headers.
If you don't want to send the RFH2 header then you might want to URL like this: queue://<QMGRname>/<QueueName>?targetClient=1
you also mention that since you have a .Net application, you don't want RFH2 headers. I don't think that is necessary. You could use the XMS Client for .Net. This give you JMS like APIs in .Net and you can use similar getString or other get properties in .net. The XMS Client for .Net is free and available in the MQ Support page. |
|
Back to top |
|
 |
mqmaniac |
Posted: Wed Jul 09, 2008 7:30 am Post subject: |
|
|
 Master
Joined: 27 Dec 2005 Posts: 201
|
|
Back to top |
|
 |
sridhsri |
Posted: Wed Jul 09, 2008 8:27 am Post subject: |
|
|
Master
Joined: 19 Jun 2008 Posts: 297
|
Sorry. I think I didn't explain it well. I meant to say that setString, setInt and other set would work only with MQRFH2.
From what I understand, you are using a JMS Application to put a message on queue. In that application if you set the replyToQ (a JMS property) it would be set in the MQRFH2 (I could be wrong here).
If you use MQJava to put a message on the queue, you would have access to MQMD and therefore you could set the replyToQ in the MQMD.
The way I understand it is that in JMS there is nothing called MQMD or even MQRFH2. There is just the JMS Header based on the JMS Specification. When IBM implements this specification on MQ, it might choose to use MQRFH2. So, if you are writing a JMS application, don't look to access the MQMD or RFH2 headers. Stick to what is available in the JMS spec |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jul 09, 2008 11:12 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Code: |
Destination myreplyto = receivedmsg.getJMSReplyTo();
MessageProducer myproducer = Session.createProducer(null);
myproducer.send(myreplyto, replymsg); |
And this is how the MDB should handle the reply.
The sender set the JMSReplyTo:
Code: |
Destination myreplyto = (Destination) ctx.lookup("ReplyToQueue");
requestmsg.setJMSReplyTo(myreplyto); |
And guys please look up a JMS tutorial as this is elementary JMS.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
zpat |
Posted: Wed Jul 09, 2008 9:37 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Set targetclient to non JMS on the queue object. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jul 10, 2008 1:23 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
zpat wrote: |
Set targetclient to non JMS on the queue object. |
As you retrieve the Destinations from JNDI this should already have been done in the JNDI layer and you should not have to code for it.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|