Question

I want to be able to use spring AMQP to set policies for high availability.

When configuring RabbitMQ (v3.1.4) via the web interface, you have the option under Admin to set policies.

These policies apply to all queues the policy pattern selects.

I want to configure the policies in a spring AMQP xml file but can't seem to find the relevant section.

I have tried the arguments section for configuring a queue. Example below:

<rabbit:queue name="ns.notifications" id="queue.ns.notifications">
  <rabbit:queue-arguments>
    <entry key="x-ha-policy" value="all"/>
  </rabbit:queue-arguments>
</rabbit:queue>

Thank you in advance.

Était-ce utile?

La solution

So I did not get an answer on how to do this via spring. It seems that the spring library is quite old and has not been updated to cater for the newer implementations of RabbitMQ.

With that said, all is not lost.

Instead of using Spring we setup a policy via the RabbitMQ administration tool.

Hope this helps someone.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top