Author |
Message
|
parsi_sudhakar |
Posted: Mon Nov 06, 2006 12:03 pm Post subject: Message reaches MQ alias Queue but it dont reach target |
|
|
Newbie
Joined: 06 Nov 2006 Posts: 5
|
Message reaches MQ alias Queue/local queue but it dont reach target queue. When I put a message in a queue the currdepth increases by 1 but I am unable to read the message from the queue.
Environment set up:
- WebSphere Application Server (WAS) v5.1.x installed on AIX
- MQ Client support on AIX
- MQ server installed on Z/OS main frame with REQ and REPLY queues
- My java code does the synchronous messaging, it puts the message succesfully in the request queue and waits in the reply queue for the reply.
Problem:
Message appears on the local queue but never reaches the destination queue and once the waiting in reply queue times out. The message disappears from the request queue. |
|
Back to top |
|
 |
zpat |
Posted: Mon Nov 06, 2006 12:38 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Try coding MQPMO_NO_SYNCPOINT for the MQPUT and MQGMO_NO_SYNCPOINT for the MQGET in the z/OS server application.
Or issue MQCMIT in the server application of course.
Display the queue - does it have uncommitted messages shown? |
|
Back to top |
|
 |
parsi_sudhakar |
Posted: Mon Nov 06, 2006 1:27 pm Post subject: |
|
|
Newbie
Joined: 06 Nov 2006 Posts: 5
|
My application java code uses the TextMessage class but not the MQPutMessageOptions, so I cant use the SYNCPOINT options while putting the message to the queue.
In my application the mq get and put methods are part of the EJB container managed transaction, so I tried using the EJB transaction attribute NOTSUPPORTED, but still have the same problem. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Nov 06, 2006 3:40 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
We need to clarify a few things:
a) who is the requester WebSphere or zOS?
Assuming that the requester is WAS and that you have the CAF installed (using MQClient on AIX) and that zOS is to be the server, how do you time out ?
I see you set the transaction not supported attribute. Now you may still have to deal with the MQ transaction depending on how you configured the Session.
Keep it simple. Do a session.commit after the send. Then wait on the request queue.
How do you define that the message is not picked up? Do you check for the correlation Id? Do you just pick up the next message? Is your reply queue a temporary one (will not accept persistent messages...)?
We need more info...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
parsi_sudhakar |
Posted: Mon Nov 06, 2006 5:20 pm Post subject: |
|
|
Newbie
Joined: 06 Nov 2006 Posts: 5
|
The requestor is websphere.
The send.commit gives an error '2 phase committ is not allowed where 1 phase committ is allowed'.
When the message is put the correllation ID is created and immediately wait back in a response queue to get the reply message
The queue is not a temporary queue its a local queue on the application server. |
|
Back to top |
|
 |
zpat |
Posted: Tue Nov 07, 2006 12:45 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
I referred to the SERVER application (assuming there is one), not the requestor.
Test your application in parts, make sure the request message appears before having a server application running etc. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Nov 07, 2006 3:44 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
zpat wrote: |
I referred to the SERVER application (assuming there is one), not the requestor.
Test your application in parts, make sure the request message appears before having a server application running etc. |
When the message appears make sure you can browse it...before you enter the WAS wait...
Run WAS in debug mode so that the wait is not yet entered... _________________ MQ & Broker admin |
|
Back to top |
|
 |
parsi_sudhakar |
Posted: Tue Nov 07, 2006 8:21 am Post subject: |
|
|
Newbie
Joined: 06 Nov 2006 Posts: 5
|
When I test the application in parts with a test program, it works.
But while testing through the application it fails.
Scenario:
Created a local queue called TEST
Program put message in queue called TEST
tried to browse message in queue but it disappeared
Program get will wait (x) time for the reply (In test scenario we expect timeout because we are putting the message locally)
Problem:
Message behaves like it is not committed but we can resolve the problem.
Tried the following:
1. Thru the WAS admin - disabled the XA transaction
[11/2/06 21:16:21:778 UTC] 306079c3 TransactionIm E WTRN0062E: An illegal attempt to use multiple resources that have on
ly one-phase capability has occurred within a global transaction.
[11/2/06 21:16:21:798 UTC] 306079c3 LocalTransact E J2CA0030E: Method enlist caught com.ibm.ws.Transaction.IllegalResour
ceIn2PCTransactionException
2. setting the EJB transaction attribute to Not Supported
The code snippet used
--------------------------
Properties props = new Properties();
props.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, ARTUtil.getQueueProperty("qcf"));
props.put(javax.naming.Context.PROVIDER_URL, ARTUtil.getQueueProperty(com.ibm.websphere.naming.WsnInitialContextFactory));
InitialContext ictx = new javax.naming.InitialContext(props);
QueueConnectionFactory fieldQueueConnFactory = (QueueConnectionFactory) ictx.lookup(ARTUtil.getQueueProperty(jms/JMS_FAC));
QueueConnection fieldQueueConn = fieldQueueConnFactory.createQueueConnection();
fieldQueueConn.start();
fieldSession = fieldQueueConn.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
Queue fieldRequestQueue = null;
Queue fieldResponseQueue = null;
fieldRequestQueue = (Queue) ictx.lookup("jms/reqQueue");
fieldResponseQueue = (Queue) ictx.lookup("jms/respQueue"));
QueueReceiver receiver = null;
QueueSender sender = null;
sender = fieldSession.createSender(fieldRequestQueue);
TextMessage jmsRequestMsg = fieldSession.createTextMessage();
jmsRequestMsg.setJMSReplyTo(fieldResponseQueue);
jmsRequestMsg.setJMSExpiration(15000);
jmsRequestMsg.setText(SOAPRequestMessage);
sender.setTimeToLive(60000);
System.out.println("Before Send the jmsRequestMsg is = " + jmsRequestMsg);
sender.send(jmsRequestMsg);
fieldStoredMessage = jmsRequestMsg.getJMSMessageID().trim();
fieldStoredMessage = fieldStoredMessage.substring(3);
String jmsCorrelId = fieldStoredMessage;
receiver = fieldSession.createReceiver(fieldResponseQueue, "JMSCorrelationID='ID:" + jmsCorrelId + "'");
Message msg = receiver.receive(15000); |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Nov 07, 2006 7:40 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
What's the deal with all that manipulation of the correlID (I get it but I'd like to keep it simple...)
Repeat your tests without any message expiration. At this point you are playing with poison and you don't know whether it will just harm you or kill you....
If you can get it to work without the expiration, you can add expiration to the mix. For my taste the time you're setting might just be too short...
Like I said, you need to be able to browse the message before the server goes to listen for the reply (and after the send of course).
If it is transactional(XA) the send cannot be part of the same method... or global transaction...
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
parsi_sudhakar |
Posted: Wed Nov 08, 2006 12:53 pm Post subject: |
|
|
Newbie
Joined: 06 Nov 2006 Posts: 5
|
I want to mention that this same code works in WAS 4.0.7. When deployed in 5.1.10 it doesn't work. I am reposting the code because I had changed the transacted to "true" but the original code had it as "false".
The send and receive worked as implemented in WAS 4.0.7. We do not require a 2 phase commit so wondering if the XA Enable should be FALSE. Although we tried this and got the error above, when you mention that we can not do send/receive in the same global transaction I am thinking the issue go back to the XA enablement.
We also set the EJB to transaction NOT SUPPORTED. We don't know if the combonations are causing the issue of the message not being committed (i.e. or browsed).
Anyway, we can try with expiration unlimited.
Heres the code again where we removed the receive f(x) from the reply queue. However, it still shows the curdepth going up by 1, and when browsing there are no messages in queue. And when I come back and check the currdepth, it goes back to 0.
Code
------
Properties props = new Properties();
props.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, ARTUtil.getQueueProperty("qcf"));
props.put(javax.naming.Context.PROVIDER_URL, ARTUtil.getQueueProperty(com.ibm.websphere.naming.WsnInitialContextFactory));
InitialContext ictx = new javax.naming.InitialContext(props);
QueueConnectionFactory fieldQueueConnFactory = (QueueConnectionFactory) ictx.lookup(ARTUtil.getQueueProperty(jms/JMS_FAC));
QueueConnection fieldQueueConn = fieldQueueConnFactory.createQueueConnection();
fieldQueueConn.start();
fieldSession = fieldQueueConn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
Queue fieldRequestQueue = null;
Queue fieldResponseQueue = null;
fieldRequestQueue = (Queue) ictx.lookup("jms/reqQueue");
fieldResponseQueue = (Queue) ictx.lookup("jms/respQueue"));
QueueReceiver receiver = null;
QueueSender sender = null;
sender = fieldSession.createSender(fieldRequestQueue);
TextMessage jmsRequestMsg = fieldSession.createTextMessage();
jmsRequestMsg.setJMSReplyTo(fieldResponseQueue);
jmsRequestMsg.setJMSExpiration(60000);
jmsRequestMsg.setText(SOAPRequestMessage);
sender.setTimeToLive(60000);
System.out.println("Before Send the jmsRequestMsg is = " + jmsRequestMsg);
sender.send(jmsRequestMsg); |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Nov 08, 2006 9:31 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Remember that curdepth has no meaning to you as messages in a non gettable status (uncommitted) will increment the qdepth...
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|