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 » MQJMS2002 , topic lisenter problem

Post new topic  Reply to topic
 MQJMS2002 , topic lisenter problem « View previous topic :: View next topic » 
Author Message
tiim
PostPosted: Tue Dec 28, 2004 12:32 am    Post subject: MQJMS2002 , topic lisenter problem Reply with quote

Newbie

Joined: 22 Dec 2004
Posts: 6

HI, every one.

I've registered an exception lisener on the connection, and message listener to a topic session. However, every 20 or 30 minutes, there will be a exception be caught by the exception listener. The trace is :
javax.jms.JMSException: MQJMS2002: Fail to get message from MQ queue
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironm
ent.java(Inlined Compiled Code))
at com.ibm.mq.jms.MQTopicSubscriber.getMessage(MQTopicSubscriber.java(Co
mpiled Code))
at com.ibm.mq.jms.MQTopicSubscriber.receiveAsync(MQTopicSubscriber.java(
Compiled Code))
at com.ibm.mq.jms.contact admin.run(contact admin.java(Compile
d Code))
at java.lang.Thread.run(Thread.java:512)

linked exception is :

com.ibm.mq.MQException: MQJE001:Completion Code 2,reason 2090
at com.ibm.mq.MQSPIQueue.spiBatchedGet(MQSPIQueue.java(Compiled Code))
at com.ibm.mq.jms.MQTopicSubscriber.getMessage(MQTopicSubscriber.java(Co
mpiled Code))
at com.ibm.mq.jms.MQTopicSubscriber.receiveAsync(MQTopicSubscriber.java(
Compiled Code))
at com.ibm.mq.jms.contact admin.run(contact admin.java(Compile
d Code))
at java.lang.Thread.run(Thread.java:512)

Could every one give me a hint, what may cause this exception ?
I've check the reason code 2090, that says this is caused by a invalid wait interval to mqget call. But in my program, this is caused by underlyng message listener implementation. Is there anything I could do ?
Back to top
View user's profile Send private message
tiim
PostPosted: Tue Dec 28, 2004 12:53 am    Post subject: Reply with quote

Newbie

Joined: 22 Dec 2004
Posts: 6

more info:

once this exception is happen, in the onException method, if I try to close the session, the session.close() will block indefinitely. I don't know why.
I've closed the subscriber created in the session before the session.close(). call.

I think this may cause the problem I've asked last time. Because our program need to recover from this exception, so every time this exception is caught, the session variable will be set null, a new connection and session will be created. That cause orphan subscribers in the server's
SYSTEM.JMS.ND.SUBSCRIBER.QUEUE.
I still didn't know what exactly this queue stored, but I've seen some posts metioned that this queue may be fullfilled by orphan subsribers which may cause later new subcriber fail to get message from topic.
That exactly what our application suffers. After one or two days running, there is no messages could be get from the topic any more.

Our run time environment is the Websphere Application Server 5.0 with embeded messaging.


Thank you again.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Dec 28, 2004 11:08 am    Post subject: Reply with quote

Grand High Poobah

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

Before closing the session or the subscriber you need to stop the connection, set the listener to null. Then you can close and wrap up resources.

Enjoy
Back to top
View user's profile Send private message Send e-mail
tiim
PostPosted: Wed Dec 29, 2004 2:40 am    Post subject: Reply with quote

Newbie

Joined: 22 Dec 2004
Posts: 6

hi, thank you for you reply!

I finally found that problem is I register 2 message listener in one session.
(I use one session obect to create 2 subscriber than register 2 listeners on that 2 subscriber).

I read through the javadoc again and found following words:
"...
Once a connection has been started, any session with a registered message listener(s) is dedicated to the thread of control that delivers messages to it. It is erroneous for client code to use this session or any of its constituent objects from another thread of control. The only exception to this is the use of the session or connection close method.
..."


So I modified my code to create 2 different session to register topic listeners. And it works now. Thank you for your hint and help.

However, I'm still interest in the underlying implementation, and that session.close() blocking call is still an unkowning problem to me.

Your reply are really helpful.
Thank you again !
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » MQJMS2002 , topic lisenter problem
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.