You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Shan Wang <Sh...@igindex.co.uk> on 2009/03/31 19:23:03 UTC

Is it possible to use a pub/sub exchange but let the listener receive all messages the producer sent

Hi All,

 

According to the document, normally a listener of a publish/subscribe
kind of exchange can only receive messages after it begins running. Is
there any way to let the listeners receive all the messages ever sent by
producer?

 

Basically what I need is to have multiple listeners subscribe to the
same queue and each receive exact the same messages sent by the
producer. It does seem to be possible using QPID.

 

Thanks & Regards,

Shan

The information contained in this email is strictly confidential and for the use of the addressee only, unless otherwise indicated. If you are not the intended recipient, please do not read, copy, use or disclose to others this message or any attachment. Please also notify the sender by replying to this email or by telephone (+44 (0)20 7896 0011) and then delete the email and any copies of it. Opinions, conclusions (etc.) that do not relate to the official business of this company shall be understood as neither given nor endorsed by it. IG Index plc is a company registered in England and Wales under number 01190902. VAT registration number 761 2978 07. Registered Office: Friars House, 157-168 Blackfriars Road, London SE1 8EZ. Authorised and regulated by the Financial Services Authority. FSA Register number 114059.

Re: Is it possible to use a pub/sub exchange but let the listener receive all messages the producer sent

Posted by Arnaud Simon <as...@redhat.com>.
Andrew Wright wrote:
> Would a durable subscriber (a la JMS) work? Not sure of the c++ api to 
> recreate this. That would retain messages received on the exchange 
> since first registration of the client.
>
In the JMS world, Chan is after durable subscribers. In the AMQP world 
you would create durable queues bound to the Topic exchange.

Arnaud
> Another potential option may be a 'ring LVQ topic' - one that holds 
> the last n values which would be sent to a new joiner. Again, not sure 
> if current qpid binding semantics allow this.
>
> Cheers,
> Andrew
>
>
> On 31 Mar 2009, at 18:23, Shan Wang wrote:
>
>> Hi All,
>>
>>
>>
>> According to the document, normally a listener of a publish/subscribe
>> kind of exchange can only receive messages after it begins running. Is
>> there any way to let the listeners receive all the messages ever sent by
>> producer?
>>
>>
>>
>> Basically what I need is to have multiple listeners subscribe to the
>> same queue and each receive exact the same messages sent by the
>> producer. It does seem to be possible using QPID.
>>
>>
>>
>> Thanks & Regards,
>>
>> Shan
>>
>> The information contained in this email is strictly confidential and 
>> for the use of the addressee only, unless otherwise indicated. If you 
>> are not the intended recipient, please do not read, copy, use or 
>> disclose to others this message or any attachment. Please also notify 
>> the sender by replying to this email or by telephone (+44 (0)20 7896 
>> 0011) and then delete the email and any copies of it. Opinions, 
>> conclusions (etc.) that do not relate to the official business of 
>> this company shall be understood as neither given nor endorsed by it. 
>> IG Index plc is a company registered in England and Wales under 
>> number 01190902. VAT registration number 761 2978 07. Registered 
>> Office: Friars House, 157-168 Blackfriars Road, London SE1 8EZ. 
>> Authorised and regulated by the Financial Services Authority. FSA 
>> Register number 114059.
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Is it possible to use a pub/sub exchange but let the listener receive all messages the producer sent

Posted by Andrew Wright <at...@mac.com>.
Would a durable subscriber (a la JMS) work? Not sure of the c++ api to  
recreate this. That would retain messages received on the exchange  
since first registration of the client.

Another potential option may be a 'ring LVQ topic' - one that holds  
the last n values which would be sent to a new joiner. Again, not sure  
if current qpid binding semantics allow this.

Cheers,
Andrew


On 31 Mar 2009, at 18:23, Shan Wang wrote:

> Hi All,
>
>
>
> According to the document, normally a listener of a publish/subscribe
> kind of exchange can only receive messages after it begins running. Is
> there any way to let the listeners receive all the messages ever  
> sent by
> producer?
>
>
>
> Basically what I need is to have multiple listeners subscribe to the
> same queue and each receive exact the same messages sent by the
> producer. It does seem to be possible using QPID.
>
>
>
> Thanks & Regards,
>
> Shan
>
> The information contained in this email is strictly confidential and  
> for the use of the addressee only, unless otherwise indicated. If  
> you are not the intended recipient, please do not read, copy, use or  
> disclose to others this message or any attachment. Please also  
> notify the sender by replying to this email or by telephone (+44  
> (0)20 7896 0011) and then delete the email and any copies of it.  
> Opinions, conclusions (etc.) that do not relate to the official  
> business of this company shall be understood as neither given nor  
> endorsed by it. IG Index plc is a company registered in England and  
> Wales under number 01190902. VAT registration number 761 2978 07.  
> Registered Office: Friars House, 157-168 Blackfriars Road, London  
> SE1 8EZ. Authorised and regulated by the Financial Services  
> Authority. FSA Register number 114059.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Is it possible to use a pub/sub exchange but let the listener receive all messages the producer sent

Posted by Carl Trieloff <cc...@redhat.com>.
Alan Conway wrote:
> Shan Wang wrote:
>> Hi All,
>>
>>  
>>
>> According to the document, normally a listener of a publish/subscribe
>> kind of exchange can only receive messages after it begins running. Is
>> there any way to let the listeners receive all the messages ever sent by
>> producer?
>>
>>  
>>
>> Basically what I need is to have multiple listeners subscribe to the
>> same queue and each receive exact the same messages sent by the
>> producer. It does seem to be possible using QPID.
>
> You can have your subscribers browse rather than consume from the 
> queue. That way messages are never removed from the queue and are 
> still available to new subscribers. Of course the queue will grow 
> without limit but I gather that's what you want. 

Queue depth can be limited with the ring policy or TTL

Carl.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


RE: Is it possible to use a pub/sub exchange but let the listener receive all messages the producer sent

Posted by Shan Wang <Sh...@igindex.co.uk>.
No I wanted to remove the messages after all the clients have consumed
them. Basically my producer and consumer will be in completely different
systems, they shouldn't have any knowledge of the running status of each
other. But the consumers have to receive all messages generated by the
producer.

By the way I'm using c++ client so things like JMS won't help me much.

Actually I think it's impossible to implement if the broker itself
doesn't know how many clients have to be dispatched. Imagine if one of
the two clients is dead, what should the broker do...

Probably a separate queue is a better solution.




-----Original Message-----
From: Alan Conway [mailto:aconway@redhat.com] 
Sent: 01 April 2009 13:28
To: users@qpid.apache.org
Subject: Re: Is it possible to use a pub/sub exchange but let the
listener receive all messages the producer sent

Shan Wang wrote:
> Hi All,
> 
>  
> 
> According to the document, normally a listener of a publish/subscribe
> kind of exchange can only receive messages after it begins running. Is
> there any way to let the listeners receive all the messages ever sent
by
> producer?
> 
>  
> 
> Basically what I need is to have multiple listeners subscribe to the
> same queue and each receive exact the same messages sent by the
> producer. It does seem to be possible using QPID.

You can have your subscribers browse rather than consume from the queue.
That 
way messages are never removed from the queue and are still available to
new 
subscribers. Of course the queue will grow without limit but I gather
that's 
what you want.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org

The information contained in this email is strictly confidential and for the use of the addressee only, unless otherwise indicated. If you are not the intended recipient, please do not read, copy, use or disclose to others this message or any attachment. Please also notify the sender by replying to this email or by telephone (+44 (0)20 7896 0011) and then delete the email and any copies of it. Opinions, conclusions (etc.) that do not relate to the official business of this company shall be understood as neither given nor endorsed by it. IG Index plc is a company registered in England and Wales under number 01190902. VAT registration number 761 2978 07. Registered Office: Friars House, 157-168 Blackfriars Road, London SE1 8EZ. Authorised and regulated by the Financial Services Authority. FSA Register number 114059.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Is it possible to use a pub/sub exchange but let the listener receive all messages the producer sent

Posted by Carl Trieloff <cc...@redhat.com>.
Jonathan Robie wrote:
> Alan Conway wrote:
>> Shan Wang wrote:
>>> Hi All,
>>>
>>>  
>>>
>>> According to the document, normally a listener of a publish/subscribe
>>> kind of exchange can only receive messages after it begins running. Is
>>> there any way to let the listeners receive all the messages ever 
>>> sent by
>>> producer?
>>>
>>>  
>>>
>>> Basically what I need is to have multiple listeners subscribe to the
>>> same queue and each receive exact the same messages sent by the
>>> producer. It does seem to be possible using QPID.
>>
>> You can have your subscribers browse rather than consume from the 
>> queue. That way messages are never removed from the queue and are 
>> still available to new subscribers. Of course the queue will grow 
>> without limit but I gather that's what you want.
>
> What advantages does this have over using a separate queue for each 
> user, and a fanout exchange? 

none if the subscription is bound upfrount.

replay, if subscriptions are bound post fact

Carl.



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Is it possible to use a pub/sub exchange but let the listener receive all messages the producer sent

Posted by Jonathan Robie <jo...@redhat.com>.
Alan Conway wrote:
> Shan Wang wrote:
>> Hi All,
>>
>>  
>>
>> According to the document, normally a listener of a publish/subscribe
>> kind of exchange can only receive messages after it begins running. Is
>> there any way to let the listeners receive all the messages ever sent by
>> producer?
>>
>>  
>>
>> Basically what I need is to have multiple listeners subscribe to the
>> same queue and each receive exact the same messages sent by the
>> producer. It does seem to be possible using QPID.
>
> You can have your subscribers browse rather than consume from the 
> queue. That way messages are never removed from the queue and are 
> still available to new subscribers. Of course the queue will grow 
> without limit but I gather that's what you want.

What advantages does this have over using a separate queue for each 
user, and a fanout exchange?

Jonathan

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Is it possible to use a pub/sub exchange but let the listener receive all messages the producer sent

Posted by Alan Conway <ac...@redhat.com>.
Shan Wang wrote:
> Hi All,
> 
>  
> 
> According to the document, normally a listener of a publish/subscribe
> kind of exchange can only receive messages after it begins running. Is
> there any way to let the listeners receive all the messages ever sent by
> producer?
> 
>  
> 
> Basically what I need is to have multiple listeners subscribe to the
> same queue and each receive exact the same messages sent by the
> producer. It does seem to be possible using QPID.

You can have your subscribers browse rather than consume from the queue. That 
way messages are never removed from the queue and are still available to new 
subscribers. Of course the queue will grow without limit but I gather that's 
what you want.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Is it possible to use a pub/sub exchange but let the listener receive all messages the producer sent

Posted by ffrenchm <ff...@gmail.com>.
Hello.

does your use case not working with fanout exchange ?

++


According to the document, normally a listener of a publish/subscribe
kind of exchange can only receive messages after it begins running. Is
there any way to let the listeners receive all the messages ever sent by
producer?
 
Basically what I need is to have multiple listeners subscribe to the
same queue and each receive exact the same messages sent by the
producer. It does seem to be possible using QPID.


 


-- 
View this message in context: http://n2.nabble.com/Is-it-possible-to-use-a-pub-sub-exchange-but-let-the-listener-receive-all-messages-the-producer-sent-tp2564310p2564384.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org