diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java index ff524f9233..d6b11482ab 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java @@ -173,7 +173,7 @@ public class ActiveMQMessageHandler implements MessageHandler, FailoverEventList } } else { tempQueueName = activation.getAddress(); - AutoCreateUtil.autoCreateQueue(session, tempQueueName, selectorString); + AutoCreateUtil.autoCreateQueue(session, tempQueueName, null); } consumer = (ClientConsumerInternal) session.createConsumer(tempQueueName, selectorString); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ResourceAdapterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ResourceAdapterTest.java index 7b6f1b12cc..d2eeb6cd6d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ResourceAdapterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ResourceAdapterTest.java @@ -37,6 +37,7 @@ import org.apache.activemq.artemis.api.core.management.AddressControl; import org.apache.activemq.artemis.api.core.management.ResourceNames; import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient; import org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl; +import org.apache.activemq.artemis.core.server.Queue; import org.apache.activemq.artemis.core.server.impl.AddressInfo; import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; import org.apache.activemq.artemis.jms.client.ActiveMQDestination; @@ -194,6 +195,33 @@ public class ResourceAdapterTest extends ActiveMQRATestBase { activation.stop(); } + @Test + public void testAutoCreatedQueueNotFiltered() throws Exception { + final String destinationName = "test"; + ActiveMQResourceAdapter ra = new ActiveMQResourceAdapter(); + ra.setConnectorClassName(INVM_CONNECTOR_FACTORY); + ra.start(new BootstrapContext()); + Connection conn = ra.getDefaultActiveMQConnectionFactory().createConnection(); + conn.close(); + + ActiveMQActivationSpec spec = new ActiveMQActivationSpec(); + spec.setResourceAdapter(ra); + spec.setJndiParams("java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory;"); + spec.setMessageSelector("HeaderField = 'foo'"); + spec.setDestinationType("javax.jms.Queue"); + spec.setDestinationLookup(destinationName); + + ActiveMQActivation activation = new ActiveMQActivation(ra, new MessageEndpointFactory(), spec); + + activation.start(); + + Queue queue = server.locateQueue(destinationName); + assertNotNull(queue); + assertNull(queue.getFilter()); + + activation.stop(); + } + @Test public void testStartStop() throws Exception { ActiveMQResourceAdapter qResourceAdapter = new ActiveMQResourceAdapter();