ZiggyStardust
ZiggyStardust

Reputation: 425

Filtering in ActiveMQ Artemis. Reload of config in a cluster

A question about Filtering in ActiveMQ Artemis.

If I have a queue named MyQueue.IN and a filter only accepting a certain JMS Headers. Let's say ORDER.

In Broker.xml under the tag

<core>
      <configuration-file-refresh-period>5000</configuration-file-refresh-period>

  <queues>
    <queue name="MyQueue.IN">
        <address>MyQueue.IN</address>
        <filter string="TOSTATUS='ORDER'"/>
        <durable>true</durable>
    </queue>
  </queues>
</core>

As I read the manual, changing the Broker.xml it should now relaod config in Broker.xml every 5 seconds.

But when I change the filter to

<filter string="TOSTATUS='ORDERPICKUP'"/>

The config is not changed in ActiveMQ Artemis.

Not even if I restart the node.

It is in a cluster but I have changed Broker.xml on both sides.

Any ideas on how to change a filter on a queue? Preferably by changing the Broker.xml

/Zeddy

Upvotes: 0

Views: 740

Answers (1)

Justin Bertram
Justin Bertram

Reputation: 35038

You are seeing the expected behavior. Although this behavior may not be intuitive or particularly user friendly it is meant to protect data integrity. Queues are immutable so once they are created they can't be changed. Therefore, to "change" a queue it has to be deleted and re-created. Of course deleting a queue means losing all the messages in the queue which is potentially catastrophic. In general, there are 2 ways to delete the queue and have it re-created:

  1. Set <config-delete-queues>FORCE</config-delete-queues> in a matching <address-setting>. However, there is currently a problem with this approach which will be resolved via ARTEMIS-2076.
  2. Delete the queue via management while the broker is running. This can be done via the JMX (e.g. using JConsole), the web console, the Artemis CLI, etc. Once the broker is stopped, update the XML, and then restart the broker.

Upvotes: 1

Related Questions