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 Index » IBM MQ Java / JMS » JMS > WebLogic Bridge > MQ 5.3 CSD06 : ReplyToQ Proble

Post new topic  Reply to topic
 JMS > WebLogic Bridge > MQ 5.3 CSD06 : ReplyToQ Proble « View previous topic :: View next topic » 
Author Message
skerstetter
PostPosted: Tue Mar 16, 2004 7:28 am    Post subject: JMS > WebLogic Bridge > MQ 5.3 CSD06 : ReplyToQ Proble Reply with quote

Newbie

Joined: 16 Mar 2004
Posts: 4
Location: MD

I am trying to connect to an MQ instance via the WebLogic Messaging Bridge. I use WebLogic Startup classes to create instances of the MQXAQueueConnectionFactory and the MQQueues that I need. That much of the code uses the MQ/JMS APIs. I am hoping that the client code used to send/receive messages can be straight JMS.

I have (very nearly) everything working as I would like it, except that I have been unable to set the ReplyToQ. As a result, the application on the other end of the process, which I have no control over, fails to send a response. In my JMS client, I do set the JMSReplyTo, but as far as I can tell, this is never copied to the ReplyToQ header in the MQMessage.

Here are the relevant code snippets:

JMS Client:


XAQueueConnectionFactory factory = (XAQueueConnectionFactory)context.lookup(XAQUEUE_CONNECTION_FACTORY_JNDI_NAME);
connection = factory.createXAQueueConnection();
System.out.println("Starting connection...");
connection.start();

//create sender
System.out.println("Creating send session...");
requestSession = connection.createXAQueueSession();
Queue requestQueue = (Queue)context.lookup(REQUEST_QUEUE_JNDI_NAME);
Queue responseQueue = (Queue)context.lookup(RESPONSE_QUEUE_JNDI_NAME);
Queue mqReplyToQueue = (Queue)context.lookup("mq.jms.bridge.fdr.mq.reply.queue");
sender = requestSession.getQueueSession().createSender(requestQueue);


//send
TextMessage requestMessage = requestSession.createTextMessage(REQUEST_STRING);
System.out.println("Setting replyToQ=[" + mqReplyToQueue + "]");
requestMessage.setJMSReplyTo(mqReplyToQueue);
sender.send(requestMessage);

//receive
responseSession = connection.createXAQueueSession();
receiver = responseSession.getQueueSession().createReceiver(responseQueue);
Message message = receiver.receive(TIME_TO_WAIT); //always times out.

MQ Message in XMIT Q:


MQGET of message number 1
****Message descriptor****

StrucId : 'MD ' Version : 2
Report : 0 MsgType : 8
Expiry : -1 Feedback : 0
Encoding : 273 CodedCharSetId : 819
Format : 'MQXMIT '
Priority : 4 Persistence : 1
MsgId : X'414D5120424D4C51413246202020202040451CD020003904'
CorrelId : X'414D5120424D4C51413246202020202040451CD020003903'
BackoutCount : 0
ReplyToQ : ' '
ReplyToQMgr : 'BMLQA2F '
** Identity Context
UserIdentifier : 'mqm '
AccountingToken :
X'0239390000000000000000000000000000000000000000000000000000000006'
ApplIdentityData : ' '
** Origin Context
PutApplType : '7'
PutApplName : 'BMLQA2F '
PutDate : '20040316' PutTime : '15223097'
ApplOriginData : ' '

GroupId : X'000000000000000000000000000000000000000000000000'
MsgSeqNumber : '1'
Offset : '0'
MsgFlags : '0'
OriginalLength : '-1'

**** Message ****

length - 702 bytes

00000000: 5851 4820 0000 0001 4644 522E 4F44 532E 'XQH ....FDR.ODS.'
00000010: 5251 5354 2E51 5545 5545 2020 2020 2020 'RQST.QUEUE '
00000020: 2020 2020 2020 2020 2020 2020 2020 2020 ' '
00000030: 2020 2020 2020 2020 5143 4341 2020 2020 ' QCCA '
00000040: 2020 2020 2020 2020 2020 2020 2020 2020 ' '
00000050: 2020 2020 2020 2020 2020 2020 2020 2020 ' '
00000060: 2020 2020 2020 2020 4D44 2020 0000 0001 ' MD ....'
00000070: 0000 0000 0000 0008 FFFF FFFF 0000 0000 '................'
00000080: 0000 0111 0000 04B8 4D51 5354 5220 2020 '........MQSTR '
00000090: 0000 0004 0000 0001 414D 5120 424D 4C51 '........AMQ BMLQ'
000000A0: 4132 4620 2020 2020 4045 1CD0 2000 3903 'A2F @E.. .9.'
000000B0: 0000 0000 0000 0000 0000 0000 0000 0000 '................'
000000C0: 0000 0000 0000 0000 0000 0000 2020 2020 '............ '
000000D0: 2020 2020 2020 2020 2020 2020 2020 2020 ' '
000000E0: 2020 2020 2020 2020 2020 2020 2020 2020 ' '
000000F0: 2020 2020 2020 2020 2020 2020 424D 4C51 ' BMLQ'
00000100: 4132 4620 2020 2020 2020 2020 2020 2020 'A2F '
00000110: 2020 2020 2020 2020 2020 2020 2020 2020 ' '
00000120: 2020 2020 2020 2020 2020 2020 6D71 6D20 ' mqm '
00000130: 2020 2020 2020 2020 0239 3900 0000 0000 ' .99.....'
00000140: 0000 0000 0000 0000 0000 0000 0000 0000 '................'
00000150: 0000 0000 0000 0006 2020 2020 2020 2020 '........ '
00000160: 2020 2020 2020 2020 2020 2020 2020 2020 ' '
00000170: 2020 2020 2020 2020 0000 001C 5765 6273 ' ....Webs'
00000180: 7068 6572 6520 4D51 2043 6C69 656E 7420 'phere MQ Client '
00000190: 666F 7220 4A61 7661 3230 3034 3033 3136 'for Java20040316'
000001A0: 3135 3232 3330 3937 2020 2020 3C3F 786D '15223097 <?xm'
000001B0: 6C20 7665 7273 696F 6E3D 2231 2E30 223F 'l version="1.0"?'
000001C0: 3E3C 4644 5220 7665 7273 696F 6E3D 2231 '><FDR version="1'
000001D0: 2E30 223E 3C53 4543 5552 4954 593E 3C55 '.0"><SECURITY><U'
000001E0: 5345 5249 443E 4557 414C 4B45 523C 2F55 'SERID>EWALKER</U'

000001F0: 5345 5249 443E 3C50 4153 5357 443E 4349 'SERID><PASSWD>CI'
00000200: 4552 5241 3C2F 5041 5353 5744 3E3C 2F53 'ERRA</PASSWD></S'
00000210: 4543 5552 4954 593E 3C55 5345 5244 4154 'ECURITY><USERDAT'
00000220: 413E 5175 6572 7920 546F 6F6C 2047 656E 'A>Query Tool Gen'
00000230: 6572 6174 6564 3C2F 5553 4552 4441 5441 'erated</USERDATA'
00000240: 3E3C 4F44 5352 4551 5545 5354 3E3C 524F '><ODSREQUEST><RO'
00000250: 5744 4546 3E59 3C2F 524F 5744 4546 3E3C 'WDEF>Y</ROWDEF><'
00000260: 434F 4C55 4D4E 4944 3E4E 3C2F 434F 4C55 'COLUMNID>N</COLU'
00000270: 4D4E 4944 3E3C 4558 4543 3E22 434E 4F4E 'MNID><EXEC>"CNON'
00000280: 4D4F 4E22 2C22 3530 3439 3930 3330 3032 'MON","5049903002'
00000290: 3533 3435 3234 222C 2231 3235 222C 2230 '534524","125","0'
000002A0: 3033 3222 3C2F 4558 4543 3E3C 2F4F 4453 '032"</EXEC></ODS'
000002B0: 5245 5155 4553 543E 3C2F 4644 523E 'REQUEST></FDR> '


I appreciate any help. Reading through all of the documentation, I would expect this to work.

Shawn
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
jefflowrey
PostPosted: Tue Mar 16, 2004 7:33 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I believe that JMSReplyTo has to be in a URL form, something like "queue://queuemgr/queue".

You don't list what your mqReplyToQueue parameter contains.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
skerstetter
PostPosted: Tue Mar 16, 2004 7:40 am    Post subject: Reply with quote

Newbie

Joined: 16 Mar 2004
Posts: 4
Location: MD

Here is the output from the console:

[kerstetter@legolas bin]$ ./testMessageBridge.sh
Creating InitialContext...
Starting connection...
Creating send session...
Setting replyToQ=[queue:///BML.FDRODS.MQ01.SYNC]
Sending message=[TextMessage[null, <?xml version="1.0"?><FDR vers...]]
Request Message ID is =[ID:P<585146.1079450550859.0>]
Receiver timed out.

Here is the code which creates the MQQueues and binds them to WebLogic JNDI:

Code:


        InitialContext context = new InitialContext();
        XAQueueConnectionFactory factory = (XAQueueConnectionFactory) context.lookup(factoryJNDIName);     
        XAQueueConnection connection = factory.createXAQueueConnection();
        XAQueueSession session = connection.createXAQueueSession();
        Queue queue = session.getQueueSession().createQueue(queueName);
       
        if ("MQ".equalsIgnoreCase(targetClient)) { //true for request, false for reply
            ((MQQueue) queue).setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ);
        }
       
        JNDIUtil.bind(queueJNDIName, queue);
       
        //clean up
        session.close();
        connection.close();


Here is the code for the MQQueueConnectionFactory:

Code:


       
        //create connection factory
        String channel = (String) args.get(CHANNEL_PROPERTY);
        String qmHost  = (String) args.get(QM_HOST_PROPERTY);
        String qmPort  = (String) args.get(QM_PORT_PROPERTY);           
       
        MQXAQueueConnectionFactory factory = new MQXAQueueConnectionFactory();
        factory.setQueueManager(qmName);
        factory.setHostName(qmHost);
       
        if (channel != null) {
            factory.setChannel(channel);
        }
       
        if (qmHost == null) { //currently, always false
            factory.setTransportType(JMSC.MQJMS_TP_BINDINGS_MQ);
        } else {
            factory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
        }
       
        if (qmPort != null) {
            try {
                int portNum = Integer.parseInt(qmPort);
                factory.setPort(portNum);
            } catch (NumberFormatException ignore) {
                //ignore
            }
        }
       
        JNDIUtil.bind(jndiName, factory);


Nice feature, that "code" button.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
vennela
PostPosted: Tue Mar 16, 2004 10:27 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Couple of things:
1. Put the message to a local queue and use amqsbcg to verify whether replyToQ field of MQMD is set or not.
2. Does the other side require only replyToQ or does it require both replyToQ and replyToQMGR also. Because your code supplies only replyToQ
Back to top
View user's profile Send private message Send e-mail Visit poster's website
skerstetter
PostPosted: Tue Mar 16, 2004 10:38 am    Post subject: Re: JMS > WebLogic Bridge > MQ 5.3 CSD06 : ReplyToQ Pr Reply with quote

Newbie

Joined: 16 Mar 2004
Posts: 4
Location: MD

Actually, I believe I included what you are asking for in my original post. I've included the results of the amqsbcg from that post below for clarity and used the "code" feature this time to pretty print it. The way I read it the ReplyToQMgr is getting set, but the ReplyToQ is not. I too noticed that the QMgr isn't included in the MQQueue URL, which would seem to be inconsistent

skerstetter wrote:


Code:

MQ Message in XMIT Q:

 
 MQGET of message number 1
****Message descriptor****
 
  StrucId  : 'MD  '  Version : 2
  Report   : 0  MsgType : 8
  Expiry   : -1  Feedback : 0
  Encoding : 273  CodedCharSetId : 819
  Format : 'MQXMIT  '
  Priority : 4  Persistence : 1
  MsgId : X'414D5120424D4C51413246202020202040451CD020003904'
  CorrelId : X'414D5120424D4C51413246202020202040451CD020003903'
  BackoutCount : 0
  ReplyToQ       : '                                                '
  ReplyToQMgr    : 'BMLQA2F                                         '
  ** Identity Context
  UserIdentifier : 'mqm         '
  AccountingToken :
   X'0239390000000000000000000000000000000000000000000000000000000006'
  ApplIdentityData : '                                '
  ** Origin Context
  PutApplType    : '7'
  PutApplName    : 'BMLQA2F                     '
  PutDate  : '20040316'    PutTime  : '15223097'
  ApplOriginData : '    '
 
  GroupId : X'000000000000000000000000000000000000000000000000'
  MsgSeqNumber   : '1'
  Offset         : '0'
  MsgFlags       : '0'
  OriginalLength : '-1'
 
****   Message      ****
 
 length - 702 bytes
 
00000000:  5851 4820 0000 0001 4644 522E 4F44 532E 'XQH ....FDR.ODS.'
00000010:  5251 5354 2E51 5545 5545 2020 2020 2020 'RQST.QUEUE      '
00000020:  2020 2020 2020 2020 2020 2020 2020 2020 '                '
00000030:  2020 2020 2020 2020 5143 4341 2020 2020 '        QCCA    '
00000040:  2020 2020 2020 2020 2020 2020 2020 2020 '                '
00000050:  2020 2020 2020 2020 2020 2020 2020 2020 '                '
00000060:  2020 2020 2020 2020 4D44 2020 0000 0001 '        MD  ....'
00000070:  0000 0000 0000 0008 FFFF FFFF 0000 0000 '................'
00000080:  0000 0111 0000 04B8 4D51 5354 5220 2020 '........MQSTR   '
00000090:  0000 0004 0000 0001 414D 5120 424D 4C51 '........AMQ BMLQ'
000000A0:  4132 4620 2020 2020 4045 1CD0 2000 3903 'A2F     @E.. .9.'
000000B0:  0000 0000 0000 0000 0000 0000 0000 0000 '................'
000000C0:  0000 0000 0000 0000 0000 0000 2020 2020 '............    '
000000D0:  2020 2020 2020 2020 2020 2020 2020 2020 '                '
000000E0:  2020 2020 2020 2020 2020 2020 2020 2020 '                '
000000F0:  2020 2020 2020 2020 2020 2020 424D 4C51 '            BMLQ'
00000100:  4132 4620 2020 2020 2020 2020 2020 2020 'A2F             '
00000110:  2020 2020 2020 2020 2020 2020 2020 2020 '                '
00000120:  2020 2020 2020 2020 2020 2020 6D71 6D20 '            mqm '
00000130:  2020 2020 2020 2020 0239 3900 0000 0000 '        .99.....'
00000140:  0000 0000 0000 0000 0000 0000 0000 0000 '................'
00000150:  0000 0000 0000 0006 2020 2020 2020 2020 '........        '
00000160:  2020 2020 2020 2020 2020 2020 2020 2020 '                '
00000170:  2020 2020 2020 2020 0000 001C 5765 6273 '        ....Webs'
00000180:  7068 6572 6520 4D51 2043 6C69 656E 7420 'phere MQ Client '
00000190:  666F 7220 4A61 7661 3230 3034 3033 3136 'for Java20040316'
000001A0:  3135 3232 3330 3937 2020 2020 3C3F 786D '15223097    <?xm'
000001B0:  6C20 7665 7273 696F 6E3D 2231 2E30 223F 'l version="1.0"?'
000001C0:  3E3C 4644 5220 7665 7273 696F 6E3D 2231 '><FDR version="1'
000001D0:  2E30 223E 3C53 4543 5552 4954 593E 3C55 '.0"><SECURITY><U'
000001E0:  5345 5249 443E 4557 414C 4B45 523C 2F55 'SERID>EWALKER</U'
 
000001F0:  5345 5249 443E 3C50 4153 5357 443E 4349 'SERID><PASSWD>CI'
00000200:  4552 5241 3C2F 5041 5353 5744 3E3C 2F53 'ERRA</PASSWD></S'
00000210:  4543 5552 4954 593E 3C55 5345 5244 4154 'ECURITY><USERDAT'
00000220:  413E 5175 6572 7920 546F 6F6C 2047 656E 'A>Query Tool Gen'
00000230:  6572 6174 6564 3C2F 5553 4552 4441 5441 'erated</USERDATA'
00000240:  3E3C 4F44 5352 4551 5545 5354 3E3C 524F '><ODSREQUEST><RO'
00000250:  5744 4546 3E59 3C2F 524F 5744 4546 3E3C 'WDEF>Y</ROWDEF><'
00000260:  434F 4C55 4D4E 4944 3E4E 3C2F 434F 4C55 'COLUMNID>N</COLU'
00000270:  4D4E 4944 3E3C 4558 4543 3E22 434E 4F4E 'MNID><EXEC>"CNON'
00000280:  4D4F 4E22 2C22 3530 3439 3930 3330 3032 'MON","5049903002'
00000290:  3533 3435 3234 222C 2231 3235 222C 2230 '534524","125","0'
000002A0:  3033 3222 3C2F 4558 4543 3E3C 2F4F 4453 '032"</EXEC></ODS'
000002B0:  5245 5155 4553 543E 3C2F 4644 523E      'REQUEST></FDR>  '

Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
vennela
PostPosted: Tue Mar 16, 2004 1:32 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

I have run some quick tests and found that ReplyToQMgr is set by default. (if you don't explicitly set it)
But to set ReplyToQ you have to do that in your app (like the way you are trying to do).


In your app can you do

Code:
requestMessage.toString()
and see whether JMSReplyTo is set or not.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
skerstetter
PostPosted: Tue Mar 16, 2004 1:57 pm    Post subject: Reply with quote

Newbie

Joined: 16 Mar 2004
Posts: 4
Location: MD

Interesting, I add the following to my client:

Code:


                System.out.println("Setting replyToQ=[" + mqReplyToQueue + "]");
                requestMessage.setJMSReplyTo(mqReplyToQueue);
                System.out.println("JMSReplyTo set to=[" + requestMessage.getJMSReplyTo() + "]");



and got:

[kerstetter@legolas bin]$ ./testMessageBridge.sh
Creating InitialContext...
Starting connection...
Creating send session...
Setting replyToQ=[queue:///BML.FDRODS.MQ01.SYNC]
JMSReplyTo set to=[null]
Sending message=[TextMessage[null, <?xml version="1.0"?><FDR vers...]]
Request Message ID is =[ID:P<60409.1079473844091.0>]
Receiver timed out.

Which I think is from javax.jms.Message javadoc:

Note the following exception case when a provider is handling a foreign message implementation. If the foreign message implementation contains a JMSReplyTo header field that is set to a foreign destination implementation, the provider is not required to handle or preserve the value of this header field.

In which case, it looks like this is a problem with weblogic/jms.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » JMS > WebLogic Bridge > MQ 5.3 CSD06 : ReplyToQ Proble
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.