You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by jml <ja...@gmail.com> on 2015/03/11 12:10:15 UTC
How to let a topic receiver know that the related topic sender "has
gone"?
Hi,
consider the following simple setup:
A topic exchange sender in c#, a c++ broker and a topic receiver in c#.
sender created with:
Sender _sender = session.CreateSender("test/AAA.B;{create:always, delete:
always, node:{type:topic}}");
receiver created with:
Receiver _feed_receiver = session.CreateReceiver("test/AAA.B;{create:always,
delete: always, node:{type:topic}}");
How can I make the receiver aware of if "the sender process has gone" or if
_sender.Close()
or session.Close() has been called? I searched the docs and lists and tried
but could not find an
anwser yet.
Thx
jml
--
View this message in context: http://qpid.2158936.n2.nabble.com/How-to-let-a-topic-receiver-know-that-the-related-topic-sender-has-gone-tp7621790.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org
Re: How to let a topic receiver know that the related topic sender
"has gone"?
Posted by jml <ja...@gmail.com>.
Thx for the inspiration. I think I will go for (2). This can be easily
extended to cover
situations where the process hosting the sender and the alternate sender
died
by running a simple alternate sender process on the same box.
Thanks
Jan
--
View this message in context: http://qpid.2158936.n2.nabble.com/How-to-let-a-topic-receiver-know-that-the-related-topic-sender-has-gone-tp7621790p7621873.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org
Re: How to let a topic receiver know that the related topic sender
"has gone"?
Posted by Gordon Sim <gs...@redhat.com>.
On 03/12/2015 11:16 AM, jml wrote:
> one (but important) detail I missed to mention in the simple setup. It
> is a one-to-many setup. A number of receivers consuming from the exchange.
> As far as I understood a queue is for one-to-one communication.
> I need to "broadcast" from a sender to multiple clients (receivers) and need
> to let the clients know asap if a sender "has gone".
Ok, makes sense now. I can think of a few different options to consider:
(1) Use an LVQ or ring queue (to prevent unlimited growth) and have the
subscribers in browse mode. Delete the queue when the sender is
disconnected, which will cause the subscribers all to get an exception.
(2) Have the sender process set up a dummy queue, with a single message
in it and the alternate exchange set to be the exchange on which the
topic is based. This queue is deleted when the sender exits, at which
point the message on the dummy queue is routed through the exchange to
the subscribers. They then need to recognise it as a special indicator
that the sender has gone. (This is a bit like the mqtt last will and
testament feature).
(3) The subscribers could listen form management events about exchange
deletion to be notified when their topics exchange has been deleted
(The downside of this is that they need special permission and it is not
easy to give only fine grain control over management).
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org
Re: How to let a topic receiver know that the related topic sender
"has gone"?
Posted by jml <ja...@gmail.com>.
Hi Gordon,
one (but important) detail I missed to mention in the simple setup. It
is a one-to-many setup. A number of receivers consuming from the exchange.
As far as I understood a queue is for one-to-one communication.
I need to "broadcast" from a sender to multiple clients (receivers) and need
to let the clients know asap if a sender "has gone".
Other concepts for example heartbeat based which I could implement on top of
existing qpid API would always involve a delay in the detection if a sender
has gone.
If the API does not support that yet, might there be another way to let a
client
be somehow else notfied maybe by the using the broker's management interface
api
if a sender has gone? Assuming I could access that from a client.
Best regards
Jan
--
View this message in context: http://qpid.2158936.n2.nabble.com/How-to-let-a-topic-receiver-know-that-the-related-topic-sender-has-gone-tp7621790p7621861.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org
Re: How to let a topic receiver know that the related topic sender
"has gone"?
Posted by Gordon Sim <gs...@redhat.com>.
On 03/11/2015 11:10 AM, jml wrote:
> Hi,
>
> consider the following simple setup:
> A topic exchange sender in c#, a c++ broker and a topic receiver in c#.
>
> sender created with:
> Sender _sender = session.CreateSender("test/AAA.B;{create:always, delete:
> always, node:{type:topic}}");
>
> receiver created with:
> Receiver _feed_receiver = session.CreateReceiver("test/AAA.B;{create:always,
> delete: always, node:{type:topic}}");
>
> How can I make the receiver aware of if "the sender process has gone" or if
> _sender.Close()
> or session.Close() has been called? I searched the docs and lists and tried
> but could not find an
> anwser yet.
You can't. A topic is essentially an exchange. Subscribers to a topic
using AMQP 0-10 will create a queue and bind this to the exchange, then
consume from the queue. Deleting the exchange has no effect on the queue
and therefore on the subscriber.
Would it be possible to use a queue instead? I mean, if you want the
publisher and subscriber to be more tightly coupled, what motivated the
choice of a topic as the communication channel?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org