Merge branch 'ARTEMIS-2531'

This closes #2872
This commit is contained in:
Christopher L. Shannon (cshannon) 2019-10-28 06:54:43 -04:00
commit 47a5406ca2
2 changed files with 5 additions and 1 deletions

View File

@ -63,7 +63,7 @@ public class FederatedQueue extends FederatedAbstract implements ActiveMQServerC
Objects.requireNonNull(config.getName());
this.config = config;
this.priorityAdjustment = federationUpstream.getPriorityAdjustment() + (config.getPriorityAdjustment() == null ? -1 : config.getPriorityAdjustment());
String metaDataFilterString = config.isIncludeFederated() ? null : FederatedQueueConsumer.FEDERATION_NAME + " IS NOT NULL";
String metaDataFilterString = config.isIncludeFederated() ? null : "hyphenated_props:" + FederatedQueueConsumer.FEDERATION_NAME + " IS NOT NULL";
metaDataFilter = FilterImpl.createFilter(metaDataFilterString);
if (config.getIncludes().isEmpty()) {
includes = Collections.emptySet();

View File

@ -177,6 +177,10 @@ public class FederatedQueueTest extends FederatedTestBase {
producer1.send(session1.createTextMessage("hello"));
assertNotNull(consumer0.receive(1000));
//Wait to see if extra consumers are created - this tests to make sure there is no loop and tests the FederatedQueue metaDataFilterString
//is working properly - should only be 1 consumer on each (1 for the local consumer on broker0 and 1 for the federated consumer on broker1)
assertFalse(Wait.waitFor(() -> getServer(0).locateQueue(SimpleString.toSimpleString(queueName)).getConsumerCount() > 1, 500, 100));
assertFalse(Wait.waitFor(() -> getServer(1).locateQueue(SimpleString.toSimpleString(queueName)).getConsumerCount() > 1, 500, 100));
//Test consumer move from broker 0, to broker 1
consumer0.close();