activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Graf (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (ARTEMIS-550) Add support for virtual topic consumers
Date Fri, 26 Jan 2018 08:05:00 GMT

    [ https://issues.apache.org/jira/browse/ARTEMIS-550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16339220#comment-16339220
] 

Benjamin Graf edited comment on ARTEMIS-550 at 1/26/18 8:04 AM:
----------------------------------------------------------------

Hi [~gtully]

I created a test case which only works if the queue is created explicitly before.
{code:java}
 @Test
    public void testVirtualTopicViaFQQN() throws Exception {
        ConnectionFactory factory = new org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory(urlString);
        server.addAddressInfo(new AddressInfo(new SimpleString("#"), RoutingType.MULTICAST));
                     
        server.getAddressSettingsRepository().getMatch("#").setAutoCreateQueues(true);
        server.createQueue(new SimpleString("TEST_TOPIC"),
                RoutingType.MULTICAST,
                new SimpleString("VirtualTopicConsumers.test"),
                null, true, false, -1, false, true);
        try (Connection connection = factory.createConnection()) {
            connection.start();
            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            Topic topic = session.createTopic("TEST_TOPIC");
            Queue queue = session.createQueue("TEST_TOPIC::VirtualTopicConsumers.test");
            MessageConsumer consumer1 = session.createConsumer(queue);
            MessageProducer producer = session.createProducer(topic);
            producer.send(session.createMessage());
            Message m = consumer1.receive(2000);
            assertNotNull(m);
        }
    }
 {code}
 AMQSession does create queue in createConsumer()  ServerSessionImpl throws Exception in
createConsumer() if binding is not available.

Snapshot from debugging what CREATE_QUEUE_V2 tries to add (ServerSessionImpl  createQueue()):

!image-2018-01-26-09-02-08-192.png!

That's why createConsumer() fails!


was (Author: graben):
Hi [~gtully]

I created a test case which only works if the queue is created explicitly before.
{code:java}
 @Test
    public void testVirtualTopicViaFQQN() throws Exception {
        ConnectionFactory factory = new org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory(urlString);
        server.addAddressInfo(new AddressInfo(new SimpleString("#"), RoutingType.MULTICAST));
                     
        server.getAddressSettingsRepository().getMatch("#").setAutoCreateQueues(true);
        server.createQueue(new SimpleString("TEST_TOPIC"),
                RoutingType.MULTICAST,
                new SimpleString("VirtualTopicConsumers.test"),
                null, true, false, -1, false, true);
        try (Connection connection = factory.createConnection()) {
            connection.start();
            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            Topic topic = session.createTopic("TEST_TOPIC");
            Queue queue = session.createQueue("TEST_TOPIC::VirtualTopicConsumers.test");
            MessageConsumer consumer1 = session.createConsumer(queue);
            MessageProducer producer = session.createProducer(topic);
            producer.send(session.createMessage());
            Message m = consumer1.receive(2000);
            assertNotNull(m);
        }
    }
 {code}
 AMQSession does create queue in createConsumer()  ServerSessionImpl throws Exception in
createConsumer() if binding is not available.

Snapshot from debugging what CREATE_QUEUE_V2 tries to add:

!image-2018-01-26-09-02-08-192.png!

> Add support for virtual topic consumers
> ---------------------------------------
>
>                 Key: ARTEMIS-550
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-550
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 1.3.0
>            Reporter: Benjamin Graf
>            Assignee: Martyn Taylor
>            Priority: Major
>         Attachments: image-2018-01-26-09-02-08-192.png
>
>
> Artemis should support virtual topic consumers as alternative to topic subscriptions
as ActiveMQ itself does.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message