|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Problem with MessageListener |
« View previous topic :: View next topic » |
Author |
Message
|
dlamond1 |
Posted: Tue Sep 11, 2007 9:23 am Post subject: Problem with MessageListener |
|
|
Novice
Joined: 14 Feb 2007 Posts: 12
|
Hi all,
Here is a problem description from one of the developer here
"Context:
Stand alone java application running JDK 1.42
IBM JMS Implementation-Version (from manifest) : 6.0.0.0 - j000-L050519.1
There is the sequence of JMS Calls in the applications
1.Create a JMS Connection
2.Create a Session.
3.call session.createQueue :
4.call session.createConsumer
5.set my Message Listener on the consumer.
6.call setExceptionListener on the connection to register an Exception Handler
7.Start receiving Messages properly.
Because we listen on multiple queues, we create multiple Session (one per thread) and register multiple Message Listener. So step 2 to 5 is done for each queue.
During the nigh, we get a Exception on the ExceptionListner: [MQJMS2002] MQJMS2002: failed to get message from MQ queue: MQJE001: Completion Code 2, Reason 2009
At this point we try a recovery : We close All session, and the connection and we redo step 1 to 5 to re-establish the conncetion. That was tested and was working properly.
In some reconnection cases, we have a bizzard behavior: Step 1 to 5 reconnect and we manage to register a listener on the first queue without Error. But on my second queue, boum, I get an Exception : [MQJMS2008] MQJMS2008: failed to open MQ queue : MQJE001: Completion Code 2, Reason 2009
Any explanation?
"
On the queue manager side I see no error in the log. Any idea? |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Sep 11, 2007 2:02 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Look up the reasons for 2009. Do a search on the forum.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
dlamond1 |
Posted: Wed Sep 12, 2007 3:48 am Post subject: |
|
|
Novice
Joined: 14 Feb 2007 Posts: 12
|
I did look for 2009 (connection broken)
The thing is it seems that the connection is lost again very rapidly (or was never established) but not for all application. Only with the one using a MessageListener.
I don't have an abnormal number of client connection at any time.
I'll add a keepalive=yes in the stanza for the queue manager and I suggested an update of client libraries to 6.0.2.
Any other suggestion? |
|
Back to top |
|
 |
dlamond1 |
Posted: Thu Sep 13, 2007 3:39 am Post subject: |
|
|
Novice
Joined: 14 Feb 2007 Posts: 12
|
Ok, It turned out the problem was in the application and how they manage the recovery in case of a broken connection.
They handle the situation by dropping and recreating the connection and the session which is fine.
But they had a grey zone when recreating everything because they were not catching any exception at that moment, so when they lost the connection in the middle of that process they just stop trying and the application simply failed.
Has for the cause of the broken connection, we are still investigating this one but it as nothing to do with MQ. |
|
Back to top |
|
 |
bdemar |
Posted: Mon Sep 24, 2007 10:07 am Post subject: |
|
|
Newbie
Joined: 22 Sep 2007 Posts: 6
|
How does your app close the connection and session, when the Listener does all the opening of the connections and sessions for you automatically? Inside the mdb OnMessage() you don't open the connection or session therefore you have no way obtaining the reference to close them. I'm lost on how you are accomplishing this, and getting the app to re-try receiving the message? |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|