temporary non persistent queues: how to detect a dead peer
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Andrea_Gambirasio
Posted On:   Tuesday, November 4, 2003 02:02 AM

Hi, we created producer-consumer system with the following communication architecture: A producer waits for requests from different consumers on a Request queue (not-persistent). Each consumer that sends a request to the producer creates a temporary queue (not-persistent), then it creates its request, and envelopes it in a JMS message. In the same JMS message the consumer stores the temporary queue in the replyTo field and sends the JMS message to the producer. In the same way the producer creates its temporary queue and sends it as a "replyTo" to the consumer on the consumer's temporary queue. After this set-up phase, consumer and producer go on exchanging their data (e.g. talk "in private")    More>>

Hi, we created producer-consumer system with the following communication architecture:

A producer waits for requests from different consumers on a Request queue (not-persistent).

Each consumer that sends a request to the producer creates a temporary queue (not-persistent), then it creates its request, and envelopes it in a JMS message. In the same JMS message the consumer stores the temporary queue in the replyTo field and sends the JMS message to the producer.

In the same way the producer creates its temporary queue and sends it as a "replyTo" to the consumer on the consumer's temporary queue.

After this set-up phase, consumer and producer go on exchanging their data (e.g. talk "in private") on their temporary queues (they always exchange not-persistent message).


Our problem is that in case the producer crashes, the consumer keeps sending data to the producer's temporary queue and does not detect that the producer is no more "at the other end of the wire".

Is there a way to have swift generate a JMS exception in case of a peer trying to write to a temporary non persistent queue where the other peer is not listening any more?
Thanks

   <<Less

Re: temporary non persistent queues: how to detect a dead peer

Posted By:   Andreas_Mueller  
Posted On:   Tuesday, November 4, 2003 02:54 AM

When your requestor dies (or disconnects) and the SwiftMQ router detects that, the temp queue is deleted as part of the connection close (this is required by the JMS spec; temp queues live as long as the connection lives).


If some other client sends to a non-existing temp. queue from the same router, it gets a InvalidDestinationException during the send (or commit).

If some other client sends to a non-existing temp. queue from a remote router, the send/commit succeeds but the message is dropped at the destination router.

Thus in the latter case there is no way to detect whether a remote temp. queue still exists or not. Of course, you could retrieve this info via the CLI Admin API from the remote router but that's too complicated. A better and more JMS-like (vendor independent) way would be to use some kind of application level 'keepalive' messages.
About | Sitemap | Contact