This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/main by this push:
     new 6874556f7c ARTEMIS-4188 auto-create + MDB using selector on queue
6874556f7c is described below

commit 6874556f7c637e22df2a08f33c21e7d43e08b83c
Author: Justin Bertram <[email protected]>
AuthorDate: Thu Mar 2 15:14:14 2023 -0600

    ARTEMIS-4188 auto-create + MDB using selector on queue
---
 .../artemis/ra/inflow/ActiveMQMessageHandler.java  |  2 +-
 .../tests/integration/ra/ResourceAdapterTest.java  | 28 ++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)

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();

Reply via email to