[rabbitmq-discuss] Newbie question - need modified fanaout/publish/subscribe behavior

Tim Watson tim at rabbitmq.com
Fri Nov 23 10:39:14 GMT 2012


Hi

On 8 Nov 2012, at 03:27, scott taggart wrote:

> the rabbitmq tutorial 3 for python talks about the publish/subscribe (fanout) model.
> 
> I have this working for multiple subscribers but I need something slightly different.
> 
> The current model says that any subscriber sees only the messages AFTER it subscribes (i.e., creates the subscriber Q) and this is the behavior I see.  I need to be able to see all messages ever sent to the exchange.  To be very clear, the current behavior is that if a publisher produces messages 1, 2, 3 and C1 starts consuming after 2 but before 3, the consumer only sees 3.  Similarly, if C2 starts after message 3, it never sees 1, 2 or 3.  I need C1 & C2 to see 1, 2, & 3 regardless of where they start in the publishing sequence.
> 
> How can I create the Q after a fanout exchange is created so that that Q sees all messages, not just post-Q creation?  If it takes a different exchange or Q model, please let me know.
> 

AFAIK this isn't supported at the moment. You could use the LVC plugin (https://github.com/simonmacmullen/rabbitmq-lvc-plugin) in order to get the last value, but to keep *all the messages* you'd need to do some more work than that. To summarise the problem, we can read the notes from the end of the LVC plugin readme:

<quote>
The semantics of another kind of value-caching exchange (other than fanout) aren't obvious. To choose one option though, say a newly-bound queue was to be given all values that match its binding key -- this would require every supported exchange type to supply a reverse routing match procedure.
</quote> 


More information about the rabbitmq-discuss mailing list