Author |
Message
|
Surge |
Posted: Mon Sep 10, 2001 8:27 am Post subject: |
|
|
Newbie
Joined: 09 Sep 2001 Posts: 4
|
Hello !
I am in very need of some help about MQSeries functioning !
I have a Java apllication. It looks up the Queue, gets QueueSender and QueueReceiver and then it sets the message listener to the receiver via setMessageListener(). The message listener implements MessageListener interface . Everything is corresponded to the documentation.
While running the application I get an exception:
"javax.jms.JMSException: MQJMS1013: operation invalid whilst session is using asynchronous delivery
"
This exception is raised in the send() method of the QueueSender instance. I can't find an explanation for MQJMS1013.
Please help ! |
|
Back to top |
|
 |
bower5932 |
Posted: Mon Sep 17, 2001 10:53 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
I just wrote a small program, and I get the same error that you do. I went out and checked one of our internal databases, and I found the following:
The program is trying to send messages and do asynchronous message listening using one active thread. This is not allowed, as the MQJMS1013 message states. The program should instantiate two different Sessions - one for asynchronous delivery and one for non-asynchronous work, like the send method.
However, when I look at the Using Java manual, it indicates under the Session object that the setMessageListener has an effect on the listening and that all forms of sending messages are supported. I'll see if I can find more detail. |
|
Back to top |
|
 |
Surge |
Posted: Tue Sep 18, 2001 3:06 am Post subject: |
|
|
Newbie
Joined: 09 Sep 2001 Posts: 4
|
Thank you very much !
Could you, please, tell me where you have found the information about that "Session" issue in the documentation ? I can hardly recall the text, I think I have seen the information about this problem, but if you could tell me where you saw it, it will help me a lot in making the problem statement or showing to the others what bug I am stuck in.
I will also post your reply on several other message boards and forums, because I have seen people posting messages like "MQJMS1013 problem."
|
|
Back to top |
|
 |
bower5932 |
Posted: Tue Sep 18, 2001 10:02 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
The comment about the Session object's setMessageListener is from the JMS interfaces and classes chapter of the Using Java manual.
I also asked around and was pointed to a comment that explains your problem. It is in the Writing MQ JMS Programs chapter under a section titled Asynchronous Delivery. It states:
Use of asynchronous delivery with a QueueReceiver marks the entire session as asynchronous. It is an error to make an explicit call to the receive methods of a QueueReceiver that is associated with a Session that is using asynchronous delivery.
So, once you setMessageListener, you disabled your ability to send syncronously and you are getting the MQJSM1013 error. Hope this helps to explain. |
|
Back to top |
|
 |
EddieA |
Posted: Wed Sep 19, 2001 5:12 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
There's also the following comments in one of the samples provided (PTPSample02):
// Now that we have stopped sending messages, we can start the
// connection. This also starts asynchronous receive on
// the session - it would be illegal to send a message while
// asynchronous receive was active on the same session.
Cheers.
_________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
Surge |
Posted: Wed Sep 19, 2001 5:13 am Post subject: |
|
|
Newbie
Joined: 09 Sep 2001 Posts: 4
|
First, thank you again for info. I compiled a new test app where I just added another Session object and made QueueSender and QueueListener in separate sessions. And test worked, messages went to MessageListener and no exception was raised.
I found the comment you pointed at while working before my desperate post . But I don't use receive() method. Maybe the comment goes deeper than I think, but - people who posted on another forum got this exception IN THE SAMPLES ! (ChatApp from the book or site, I also downloaded it once). Also I need a deeper understanding of Java and synchronization, but - another one - why did this test function with FioranoMQ JMS ? I think there is some problem witn MQSeries JMS realisation...
|
|
Back to top |
|
 |
Surge |
Posted: Wed Sep 19, 2001 5:24 am Post subject: |
|
|
Newbie
Joined: 09 Sep 2001 Posts: 4
|
While answering to bower5932 post I didn't notice a post from EddieA
Thank you all guys ! I have found the example and comments about async receive.
|
|
Back to top |
|
 |
zasel |
Posted: Tue Jul 23, 2002 9:17 am Post subject: MQJMS1013: |
|
|
Newbie
Joined: 23 Jul 2002 Posts: 1
|
|
Back to top |
|
 |
|