On 11/21/2012 01:05 PM, eugene wrote:
Yes sir!! connection.start() on the listener side fixed it. :) This is still interesting, how come I got connected in the very first place if connection.start() was not called...
The Connection.start() call is only strictly required for applications with incoming messages, i.e. consumers/subscribers. It starts up a dispatching thread to pump messages through any listeners. In the Qpid JMS client it also triggers the issuing of credit to the broker for registered subscriptions.
Anyhow, the implementation in real case scenario is this: we have a bunch of Services running around some LoadBalancers - this is our app specific services. Whenever a service dies, we want to take appropriate actions in the LoadBalancer, so when Service dies, because of auto-delete, the queue is deleted and having a listener inside the LoadBalancer we can capture this "death" and take appropriate actions.
Ok, so do you went particular LoadBalancers to get the orphaned messages from particular services that gave failed? Or should they all get all orphaned messages regardless of service?
[Btw, just as an alternative scheme in case it helps, I have found a useful pattern is to use a message on a distinct queue as a lock which gets automatically released and offered to other interested parties when the holder dies or exits.
E.g. you have non-auto deleted service queues for the different services, and the active processor (I'm assuming there should only be one at any time) subscribes exclusively to that. The active processor is chosen from a set of processes by being the first to get a lock message from the lock queue associated with the service queue. It doesn't acknowledge that messages however. The other processes standby, with a subscription open on the lock queue, but not on the service queue.
Now if the active process fails, al its unacknowledged messages will be returned to the queue they came from. For messages from the service queue this means they will go back on the service queue. For the lock message, it goes back on the lock queue and is from there delivered to one of the standby processes. Whoever receives it then subscribes to the service queue and picks up where the failed processor left off.]
Thank you for your precious time Gordon!
Most welcome! --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
