Announcement Announcement Module
Collapse
No announcement yet.
Support for mirrored queues? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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?

    Thanks,

    Roy

  • #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)
    admin.declareQueue(q)
    q
    }
    ...
    }

    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
    http://forum.springsource.org/showth...ection-failure
    Last edited by DRStevens; Jan 17th, 2012, 11:55 AM. Reason: did not include what admin was in code snippet

    Comment


    • #3
      I started working on this last week. See https://jira.springsource.org/browse/AMQP-206

      An initial commit is here https://github.com/garyrussell/sprin.../tree/AMQP-206

      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.

      Comment


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

        https://github.com/garyrussell/sprin...fd93360c19b068

        Comment


        • #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...

          Comment

          Working...
          X