[rabbitmq-discuss] How to configure

Simon MacMullen simon at rabbitmq.com
Fri Feb 17 12:58:44 GMT 2012


This is a slightly unusual thing to want to do I think.

I don't think this is a shovel question specifically, it's more of a 
routing question.

Normally if messages get sent to an arbitrary number of consumers, then 
if the number of consumers drops to zero then the messages just don't 
get routed - clearly no-one's interested. And if each message must go to 
exactly one consumer then you use a shared queue.

It sounds like you want each message to get sent to n consumers, except 
when n=0, when the messages should be buffered until someone is 
interested again.

The simplest way to do this is probably to use the alternate-exchange 
feature. Declare your "public" exchange with an alternate-exchange of 
(say) "alternate". Then declare "alternate" as a fanout exchange with 
and bind a durable queue to it. Then consumers can consume from this 
queue (to pick up any messages that were published while no-one was 
listening) and their own queue (to make sure that if there are multiple 
consumers they each get a copy of appropriate messages).

Does this make sense?

Cheers, Simon

On 15/02/12 14:47, MELIQUE Denis (MORPHO) wrote:
> Hi every body.
>
> I’m quite new with RabbitMQ, so sorry if my question is stupid.
>
> I’am currently setting a Shovel configuration to forward messages from
> one broker to another,
>
> to have a two sites Active/Semi-Active configuration. Incoming messages
> must be processed by both sites.
>
> I have set a very small testing configuration with 2 hosts.
>
> ‘Active host’ is running RabbitMQ 2.7.1 on Windows, as ‘Semi-Active’ is
> running RabbitMQ 2.6.1 on RedHat6.
>
> The test configuration is as following:
>
> - messages are posted by clients to a direct Exchange named ‘public’
>
> - consumers bind to transient queues to the ‘public’ exchange, with a
> specific key
>
> Each consumer read a message and stores it on disk.
>
> - obviously I don’t want to lost any message
>
> My Shovel configuration has: (see attached rabbitmq.config files)
>
> 1-On the Active side:
>
> - a persistent queue bound to ‘public’ exchange with all possible keys.
> So every incoming message is read by the Shovel plug-In (that’s OK)
>
> - a Shovel declaration to forward messages to the distant exchange
> declared for the
>
> 2-On the Semi-Active side:
>
> - a topic exchange to which Shovel forwards messages (that’s also OK)
>
> - a persistent queue bound to this topic exchange
>
> - a Shovel declaration to forward messages into the local ‘public’ Exchange.
>
> Everything is fine and messages are going from Active side to
> Semi-Active one.
>
> Except when consumers are not running on the Semi-Active side.
>
> In that case, messages are sent to ‘public’ Exchange and are lost
> because nobody is bound to.
>
> despite the setting : ack_mode, on_confirm
>
> Nb: if the ‘Semi-Active side’ is not started at all, it’s OK messages
> are kept in the persistent queue
>
> On the Active side.
>
> I’am looking for a way of configuring Shovel plug-in to keep messages in
> persistent queue until
>
> a consumer can process them.
>
> I thing I am probably wrong with my configuration, but I can’t figure
> where ??
>
> Thank’s a lot.
>
> Denis
>
> #
> " Ce courriel et les documents qui lui sont joints peuvent contenir des informations confidentielles ou ayant un caractère privé. S'ils ne vous sont pas destinés, nous vous signalons qu'il est strictement interdit de les divulguer, de les reproduire ou d'en utiliser de quelque manière que ce soit le contenu. Si ce message vous a été transmis par erreur, merci d'en informer l'expéditeur et de supprimer immédiatement de votre système informatique ce courriel ainsi que tous les documents qui y sont attachés."
> ******
> " This e-mail and any attached documents may contain confidential or proprietary information. If you are not the intended recipient, you are notified that any dissemination, copying of this e-mail and any attachments thereto or use of their contents by any means whatsoever is strictly prohibited. If you have received this e-mail in error, please advise the sender immediately and delete this e-mail and all attached documents from your computer system."
> #
>
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss


-- 
Simon MacMullen
RabbitMQ, VMware


More information about the rabbitmq-discuss mailing list