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 » How to detect broken subscriber connections

Post new topic  Reply to topic
 How to detect broken subscriber connections « View previous topic :: View next topic » 
Author Message
urbank
PostPosted: Mon Feb 19, 2007 4:48 am    Post subject: How to detect broken subscriber connections Reply with quote

Novice

Joined: 14 Feb 2007
Posts: 16
Location: St. Gallen / Switzerland

Environment:
Java / JDK 1.5.0
Webshpere MQ 6.x
JMS / Publish Subscribe

How can we find out about broken subscriber connections?
Which of the java-jms-subscriber-objects could be asked about its state?

For example, if we stop the WS-Manager and restart it (and 'strmqbrk') , our JMS subscriber clients lose their connections but from the application point of view, everthing seems to work fine (no exceptions), but messages remain in the queue.
For publishers, we get an exception if we can not send a message over existing broken connections and in that case we are can perform a reconnect.

Thanks for any help.


Last edited by urbank on Mon Feb 19, 2007 4:58 am; edited 2 times in total
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Feb 19, 2007 4:53 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You can use the command line sample program amqspsd to perform a publish/subscribe dump with the base MQ Broker.

With Message Broker you can use the ConfigMgr Proxy API - there is a sample Java program in the Broker Info Center.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
urbank
PostPosted: Mon Feb 19, 2007 6:05 am    Post subject: Reply with quote

Novice

Joined: 14 Feb 2007
Posts: 16
Location: St. Gallen / Switzerland

Thanks jefflowrey.

Sorry about asking the same again (just to make sure):
There are no java-classes to check subscription states with IBM Websphere MQ?

What parameters do I need with amqspsd to see dynamic information (about actual subscribers)?
We always see the same information about topics, if we have connected subscribers (the application runs) or not (the application is stopped and no subscribers are visual in MQ explorer).

Regards
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Feb 19, 2007 6:11 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The Base MQ broker is not written in Java.

There is a sample java version of amqspsd in the MQ sample code on the IBM website (rather than the MQ sample code that comes with the product) - if I recall correctly.

Maybe your applications are creating durable subscriptions.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
urbank
PostPosted: Mon Feb 19, 2007 8:32 am    Post subject: Reply with quote

Novice

Joined: 14 Feb 2007
Posts: 16
Location: St. Gallen / Switzerland

ThanX.
Where can I get the com.ibm.mq.pcf.jar which is necessary to run the DumpBroker example?

Yes, we create durable subscriptions.


Last edited by urbank on Tue Feb 20, 2007 1:11 am; edited 1 time in total
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Feb 19, 2007 8:36 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

That's the MS0b support pack.

The sample is not going to show you anything that amqspsd doesn't.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
urbank
PostPosted: Mon Feb 19, 2007 11:48 pm    Post subject: Reply with quote

Novice

Joined: 14 Feb 2007
Posts: 16
Location: St. Gallen / Switzerland

Is this conclusion correct?
The only way to make sure that a subscriber is connected (in the environment described above with durable subscribers without Message Broker) is to reconnect from time to time.
Thanks a lot for your help!
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Feb 20, 2007 3:14 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The subscriber should always know if it's connected or not - it should either get an error when trying to use it's connection, or it should get an error when the connection breaks.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
urbank
PostPosted: Tue Feb 20, 2007 9:21 am    Post subject: Reply with quote

Novice

Joined: 14 Feb 2007
Posts: 16
Location: St. Gallen / Switzerland

Because we use JMS, we just have instances of the following classes:
TopicConnection
TopicSession
TopicSubscriber
We have implemented the MessageListener - Interface and we usually get the onMessage() method called, everything works fine so far.

If the MQServer stops and restarts, our subscriber classes do not get any events but are in a state, in which they do not get any messages any more (the onMessage() method is not called any more, even if there are messages in the queue, to which they are connected).
The question is: how could we find out (in our Java code by calling a method or what ever), if the subscriber is in this broken state?

Thanks a lot again.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Feb 20, 2007 10:10 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Using an ExceptionListener.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
urbank
PostPosted: Thu Feb 22, 2007 12:37 am    Post subject: Reply with quote

Novice

Joined: 14 Feb 2007
Posts: 16
Location: St. Gallen / Switzerland

Thanks a lot jefflowrey, this is exactly what I was looking for.
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 » How to detect broken subscriber connections
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.