Announcement Announcement Module
No announcement yet.
Support for mirrored queues? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Support for mirrored queues?

    Hi all,

    We have deployed RabbitMQ 2.7.1 in an HA configuration (master-slave). We want to use Mirrored Queues:
    A mirrored-queue must be created as a mirrored-queue. It is not possible to convert a non-mirrored-queue to a mirrored-queue at some later point. It is perfectly acceptable to create a mirrored-queue with no slaves initially, though be aware of the behaviour of adding nodes to a cluster.
    To create a mirrored-queue, you provide an x-ha-policy entry in the argument table presented to queue.declare. The value of this entry is a long string which gives the name of the policy you wish to use for this queue.
    I was looking into spring-amqp (1.0.0.RELEASE), I do not see any way to declare a queue as mirrored.
    Is there a way to do it (which I have overlooked)? Or it on the roadmap for some future release?



  • #2
    There is support. You need to add a key/value pair, "x-ha-policy" -> "all", to the queue declaration parameters.

    Here is the scala

    class PimpedAmqpAdmin(admin: AmqpAdmin) {
    import PimpMyAmqp._

    def declareQueueForSharing(queueName: String): Queue = {
    val q = new Queue(queueName, true, false, false, queueDeclarationArgs)

    object PimpMyAmqp {

    val haPolicyArg = "x-ha-policy" -> "all"
    val queueDeclarationArgs: java.util.Map[String, AnyRef] = Map(haPolicyArg)

    implicit def pimpMyAmqpAdmin(a: AmqpAdmin) = new PimpedAmqpAdmin(a)

    See my thread though
    Last edited by DRStevens; Jan 17th, 2012, 10:55 AM. Reason: did not include what admin was in code snippet


    • #3
      I started working on this last week. See

      An initial commit is here

      Right now it only has code to make the reply queues in the gateway HA; I should have the attributes on the queue later today.

      This is still work-in-process so the actual attributes etc may change.


      • #4
        I should have also pointed you to the sample


        • #5
          Sorry, we are using "java-based container configuration" and it is very easy to do. I forgot that there is the whole xml thing...