[
https://issues.apache.org/jira/browse/ARTEMIS-3423?focusedWorklogId=639799&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-639799
]
ASF GitHub Bot logged work on ARTEMIS-3423:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 19/Aug/21 11:50
Start Date: 19/Aug/21 11:50
Worklog Time Spent: 10m
Work Description: gemmellr commented on a change in pull request #3697:
URL: https://github.com/apache/activemq-artemis/pull/3697#discussion_r692038270
##########
File path:
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSSharedDurableConsumerTest.java
##########
@@ -138,4 +140,46 @@ public void
testSharedDurableConsumerWithArtemisClientAndAMQPClient() throws Exc
testSharedDurableConsumer(connection, connection2);
}
+
+ @Test(timeout = 30000)
+ public void testSharedDurableConsumerWithSelector() throws JMSException {
+ SimpleString qName = amqpUseCoreSubscriptionNaming ? new
SimpleString("SharedConsumer") : new SimpleString("SharedConsumer:global");
+ Connection connection = createConnection(true);
+ try {
+ Session session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
+
+ Topic topic = session.createTopic(getTopicName());
+
+ MessageConsumer consumer = session.createSharedDurableConsumer(topic,
"SharedConsumer", "a=b");
+ QueueImpl queue = (QueueImpl)
server.getPostOffice().getBinding(qName).getBindable();
+ assertEquals(-1, queue.getMaxConsumers());
+ consumer.close();
+ MessageConsumer consumer2 =
session.createSharedDurableConsumer(topic, "SharedConsumer", "a=b and b=c");
+ queue = (QueueImpl)
server.getPostOffice().getBinding(qName).getBindable();
+ assertEquals(-1, queue.getMaxConsumers());
+ } finally {
+ connection.close();
+ }
+ }
+
+ @Test(timeout = 30000)
+ public void testUnSharedDurableConsumerWithSelector() throws JMSException {
+ SimpleString qName = new SimpleString("foo.SharedConsumer");
+ Connection connection = createConnection("foo", true);
+ try {
+ Session session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
+
+ Topic topic = session.createTopic(getTopicName());
+
+ MessageConsumer consumer = session.createDurableConsumer(topic,
"SharedConsumer", "a=b", false);
+ QueueImpl queue = (QueueImpl)
server.getPostOffice().getBinding(qName).getBindable();
+ assertEquals(1, queue.getMaxConsumers());
+ consumer.close();
+ MessageConsumer consumer2 = session.createDurableConsumer(topic,
"SharedConsumer", "a=b and b=c", false);
+ queue = (QueueImpl)
server.getPostOffice().getBinding(qName).getBindable();
+ assertEquals(1, queue.getMaxConsumers());
Review comment:
I've put in a followup for the remaining issue
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 639799)
Time Spent: 1h 10m (was: 1h)
> recreated shared durable subscription is created as unshared
> ------------------------------------------------------------
>
> Key: ARTEMIS-3423
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3423
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: AMQP
> Affects Versions: 2.18.0
> Reporter: Andy Taylor
> Assignee: Andy Taylor
> Priority: Major
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> This is just in the AMQP layer, if a shared durable subscription is recreated
> because of a change in message selector it gets created as unshared
> (maxconsumers=1)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)