[rabbitmq-discuss] Cluster capability?
Simon MacMullen
simon at rabbitmq.com
Tue Nov 26 09:55:19 GMT 2013
On 25/11/2013 18:10, Paul Bell wrote:
> "Virtual hosts, exchanges, users, and permissions are automatically
> mirrored across all nodes in a cluster. Queues may be located on a
> single node, or mirrored across multiple nodes
> <http://www.rabbitmq.com/ha.html>. A client connecting to any node in a
> cluster can see all queues in the cluster, even if they are not located
> on that node."
>
> Question: does the last sentence apply to both queues located on a
> single node and to mirrored (HA) queues?
Yes.
> The last clause of that
> sentence, e.g., "..even if they are not located on that node" suggests
> that whether or not the queues are mirrored shouldn't matter, i.e.,
> client will see the queues regardless of the cluster it connects to.
Yes. And of course just because a queue is mirrored doesn't mean it has
to be on *every* node in the cluster - you don't have to use ha-mode: all.
> The cluster approach "feels" complex to me but that is, at least in
> part, due to the fact that my once modest Rabbit skills have atrophied
> over the last couple of year. So, here's some thinking out loud with
> attendant questions:
>
> 1. Let's see, so, the several computers on which my (Java) RabbitMQ
> component runs will be joined together in a cluster.
> 2. What happens if Computer A creates some exchanges and then computer
> B, either before or after joining the cluster, creates the same
> exchanges? Maybe the usual Rabbit idempotency holds here; i.e., if
> exchange exists within the cluster, it's not going to be re-created...?
Yes, the exchange (along with other metadata) is held in a distributed
database and created atomically.
> 3. And if the component publishes to an exchange that message should (I
> think) be visible on the mirrored exchanges on all of the other nodes in
> the cluster, right?
Yes. We don't normally talk about "mirrored exchanges" since all
exchanges are inherently mirrored.
> 4. And, moreover, once a consumer on any cluster node reads that
> message, no other consumer will be able to read it. I sure hope this is
> true.
If it only got routed to one queue. Obviously if it was routed to two
queues it can be read twice, and so on.
Also the message can be seen by two consumers if one consumer is
consuming in ack mode, then sees the message and either rejects it or
crashes before acknowledging it. That's true on a single node though,
nothing to do with clustering.
Cheers, Simon
More information about the rabbitmq-discuss
mailing list