ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexIBM MQ Java / JMSWAs applications unable to reply to dynamic ReplyToQ?

Post new topicReply to topic
WAs applications unable to reply to dynamic ReplyToQ? View previous topic :: View next topic
Author Message
pcelari
PostPosted: Wed May 07, 2008 11:25 am Post subject: WAs applications unable to reply to dynamic ReplyToQ? Reply with quote

Chevalier

Joined: 31 Mar 2006
Posts: 411
Location: New York

standalone MQ applications can be written to send reply to the right ReplyToQ specified in the request msg's MQMD.ReplyToQ, ReplyToQMgr fields, which are often dynamic in nature, can be temp. queues.

But when the server application is running inside WAS environment, WAS developers told me it can't be done since they have to create a static entry for each queue, i.e. it can't be run-time determined.

I think there must be a way to provide such a fundamental functionality even inside WAS. But since I have few knowledge about WAS, I couldn't argue about this lack of capability in WAS.

Can an expert who happens to know enough about WAS give some insight on this question?

thanks a lot!

_________________
pcelari
-----------------------------------------
- a master of always being a newbie
Back to top
View user's profile Send private message
tleichen
PostPosted: Wed May 07, 2008 12:12 pm Post subject: Re: WAs applications unable to reply to dynamic ReplyToQ? Reply with quote

Yatiri

Joined: 11 Apr 2005
Posts: 663
Location: Center of the USA

pcelari wrote:
...
But when the server application is running inside WAS environment, WAS developers told me it can't be done since they have to create a static entry for each queue, i.e. it can't be run-time determined...
Wrong. The methodology is the same even if coming from WAS. Either the WAS developer is working withing a primitive framework that has not provided for it, or he just does not know much about the MQ API.
_________________
IBM Certified MQSeries Specialist
IBM Certified MQSeries Developer
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed May 07, 2008 1:44 pm Post subject: Re: WAs applications unable to reply to dynamic ReplyToQ? Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

tleichen wrote:
pcelari wrote:
...
But when the server application is running inside WAS environment, WAS developers told me it can't be done since they have to create a static entry for each queue, i.e. it can't be run-time determined...
Wrong. The methodology is the same even if coming from WAS. Either the WAS developer is working withing a primitive framework that has not provided for it, or he just does not know much about the MQ API.


Let's be clear. The JMS framework I hope the WAS developer is following provides for the use of dynamic queues. You just need to provide the corresponding MODEL QUEUE in the JNDI SETUP of the QCF.

The other thing that you did not specify was if the messages were persistent or not.
You cannot send persistent messages to a temporary dynamic queue. Have those sent to a fixed queue to be picked up by CorrelId.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
pcelari
PostPosted: Wed May 07, 2008 4:41 pm Post subject: Reply with quote

Chevalier

Joined: 31 Mar 2006
Posts: 411
Location: New York

thanks for the insight.

Actually, I showed them how to do this in MQ JMS two years back - just two lines of code.

But since they moved to WAS, I wasn't sure WAS has the same environment. many thanks.
_________________
pcelari
-----------------------------------------
- a master of always being a newbie
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Wed May 07, 2008 5:43 pm Post subject: Re: WAs applications unable to reply to dynamic ReplyToQ? Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

fjb_saper wrote:
tleichen wrote:
pcelari wrote:
...
But when the server application is running inside WAS environment, WAS developers told me it can't be done since they have to create a static entry for each queue, i.e. it can't be run-time determined...
Wrong. The methodology is the same even if coming from WAS. Either the WAS developer is working withing a primitive framework that has not provided for it, or he just does not know much about the MQ API.


Let's be clear. The JMS framework I hope the WAS developer is following provides for the use of dynamic queues. You just need to provide the corresponding MODEL QUEUE in the JNDI SETUP of the QCF.

This would create a new dynamic queue. But I think the poster is asking how can WAS be configured to reply to a queue name that is present in the MQMD_ReplyToQ of the request message, if that reply q name is not known before hand. It doesn't matter if the reply q is a plain local queue or an already existing dynamic queue in this question.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
pcelari
PostPosted: Wed May 07, 2008 5:57 pm Post subject: Reply with quote

Chevalier

Joined: 31 Mar 2006
Posts: 411
Location: New York

that's exactly what I want to achieve.

following are a few lines of JMS code I tried to push JAVA developers to use 2 years back:

code snippet in Java JMS:
Destination des = msg.getJMSReplyTo();
String desQueueName = ((Queue)des).getQueueName();
Queue desQueue = session.createQueue(desQueueName+”? targclient=1”);
QueueSender qSender = session.createSender(desQueue);
createTextMessage msg1 = session.createTextMessage();

this way, the replyToQ can be dynamic queue, just has to exist by then. Below are their corresponding C code.

code snippet in C:
strncpy(md.ReplyToQ, replyQ, MQ_Q_NAME_LENGTH);
strcpy(md.ReplyToQMgr, " "); /* blank the ReplyToQMgr field */

Am I right?
_________________
pcelari
-----------------------------------------
- a master of always being a newbie
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed May 07, 2008 9:40 pm Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

pcelari wrote:
that's exactly what I want to achieve.

following are a few lines of JMS code I tried to push JAVA developers to use 2 years back:

code snippet in Java JMS:
Destination des = msg.getJMSReplyTo();
String desQueueName = ((Queue)des).getQueueName();
Queue desQueue = session.createQueue(desQueueName+”? targclient=1”);
QueueSender qSender = session.createSender(desQueue);
createTextMessage msg1 = session.createTextMessage();

this way, the replyToQ can be dynamic queue, just has to exist by then. Below are their corresponding C code.

code snippet in C:
strncpy(md.ReplyToQ, replyQ, MQ_Q_NAME_LENGTH);
strcpy(md.ReplyToQMgr, " "); /* blank the ReplyToQMgr field */

Am I right?


Way too complicated:

Code:
Destination des = inmsg.getJMSReplyTo();
QueueSender qSender = session.createSender(des);

V6 has a setting on the qcf which allows you to keep the targetClient setting... i.e. no RFH on the reply msg if it was absent on the inbound msg? (targetClientMatching=true)

Enjoy
moved to JMS forum
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ Java / JMSWAs applications unable to reply to dynamic ReplyToQ?
Jump to:



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
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.