Artemis 2.2.0, createTopic create an anycast when there is no consumer created

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Artemis 2.2.0, createTopic create an anycast when there is no consumer created

vchen1
This post was updated on .
I just downloaded the latest Artemis 2.2.0 and trying to test it with sending message through a Topic. Here is my config in broker.xml (Basically, it is default from the box):

<security-settings>
         <security-setting match="#">
            <permission type="createNonDurableQueue" roles="amq"/>
            <permission type="deleteNonDurableQueue" roles="amq"/>
            <permission type="createDurableQueue" roles="amq"/>
            <permission type="deleteDurableQueue" roles="amq"/>
            <permission type="createAddress" roles="amq"/>
            <permission type="deleteAddress" roles="amq"/>
            <permission type="consume" roles="amq"/>
            <permission type="browse" roles="amq"/>
            <permission type="send" roles="amq"/>
           
            <permission type="manage" roles="amq"/>
         </security-setting>
      </security-settings>

<address-setting match="#">
            <dead-letter-address>DLQ</dead-letter-address>
            <expiry-address>ExpiryQueue</expiry-address>
            <redelivery-delay>0</redelivery-delay>
           
            <max-size-bytes>-1</max-size-bytes>
            <message-counter-history-day-limit>10</message-counter-history-day-limit>
            <address-full-policy>PAGE</address-full-policy>
            <auto-create-queues>true</auto-create-queues>
            <auto-create-addresses>true</auto-create-addresses>
            <auto-create-jms-queues>true</auto-create-jms-queues>
            <auto-create-jms-topics>true</auto-create-jms-topics>
         </address-setting>


Here is my sender side code:
String connectionUrl = "amqp://localhost:5672";
ConnectionFactory connectionFactory = new JmsConnectionFactory(connectionUrl);
connection = connectionFactory.createConnection();

session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Topic topicQueue = session.createTopic("SpyTopic9");
MessageProducer topicSender = session.createProducer(topicQueue);


and receiver side:
Topic topicQueue = session.createTopic("SpyTopic9");
MessageConsumer topicConsumer = session.createConsumer(topicQueue);

my sender and receiver code is a 2 separate program which located on 2 different machine. I noticed that if I start sender side program first without receiver side code running, the artemis created a anycast instead of multicast. And at this time, if I start the receiver side, it shows me the following message :

 Exception:Address SpyTopic9 is not configured for topic support [condition = amqp:illegal-state]

And if I started receiver first and then start sender, then everything looks fine. The topic is created with multicast. I would like to know if there is any configuration I should do or this is intended to be? Or I have to pre-config the topic in broker.xml?


Thanks,

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Artemis 2.2.0, createTopic create an anycast when there is no consumer created

Justin Bertram
I think this may be a bug.  If you send a message to a JMS topic then I
believe the auto-created address should support multicast.


Justin

On Fri, Aug 4, 2017 at 10:25 AM, vchen1 <[hidden email]> wrote:

> I just downloaded the latest Artemis 2.2.0 and trying to test it with
> sending
> message through a Topic. Here is my config in broker.xml (Basically, it is
> default from the box):
>
> <security-settings>
>          <security-setting match="#">
>             <permission type="createNonDurableQueue" roles="amq"/>
>             <permission type="deleteNonDurableQueue" roles="amq"/>
>             <permission type="createDurableQueue" roles="amq"/>
>             <permission type="deleteDurableQueue" roles="amq"/>
>             <permission type="createAddress" roles="amq"/>
>             <permission type="deleteAddress" roles="amq"/>
>             <permission type="consume" roles="amq"/>
>             <permission type="browse" roles="amq"/>
>             <permission type="send" roles="amq"/>
>
>             <permission type="manage" roles="amq"/>
>          </security-setting>
>       </security-settings>
>
> Here is my sender side code:
> String connectionUrl = "amqp://localhost:5672";
> ConnectionFactory connectionFactory = new
> JmsConnectionFactory(connectionUrl);
> connection = connectionFactory.createConnection();
>
> session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
> Topic topicQueue = session.createTopic("SpyTopic9");
> MessageProducer topicSender = session.createProducer(topicQueue);
>
>
> and receiver side:
> Topic topicQueue = session.createTopic("SpyTopic9");
> MessageConsumer topicConsumer = session.createConsumer(topicQueue);
>
> my sender and receiver code is a 2 separate program which located on 2
> different machine. I noticed that if I start sender side program first
> without receiver side code running, the artemis created a anycast instead
> of
> multicast. And at this time, if I start the receiver side, it shows me the
> following message :
>
>  Exception:Address SpyTopic9 is not configured for topic support [condition
> = amqp:illegal-state]
>
> And if I started receiver first and then start sender, then everything
> looks
> fine. The topic is created with multicast. I would like to know if there is
> any configuration I should do or this is intended to be? Or I have to
> pre-config the topic in broker.xml?
>
>
> Thanks,
>
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/Artemis-2-2-0-createTopic-create-an-anycast-
> when-there-is-no-consumer-created-tp4729269.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Artemis 2.2.0, createTopic create an anycast when there is no consumer created

vchen1
Further more, I have tested the following case:
I pre-configured a topic in broker.xml:

<address name="preDefTopic">
            <multicast/>
</address>


And test the same sequence as I described earlier:
1.) Start sender program first and send a message, and then start receiver. There is a multicast queue created after I started receiver. However, I couldn't located the message I send to the topic. The message count on the newly created multicast queue is 0. Is there a way to retrieve the message sent to the topic before receiver registered to the topic?

2.) Start receiver first and then start sender, now the message received successfully.

Thanks,
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Artemis 2.2.0, createTopic create an anycast when there is no consumer created

Justin Bertram
> Is there a way to retrieve the message sent to the topic before receiver
registered to the topic?

No.  This is basic publish-subscribe semantics.  Only messages published
after the subscription is created are received.

Pre-creating the address with the desired routing-type is a work-around.  I
still think this is a bug.


Justin

On Fri, Aug 4, 2017 at 12:26 PM, vchen1 <[hidden email]> wrote:

> Further more, I have tested the following case:
> I pre-configured a topic in broker.xml:
>
> <address name="preDefTopic">
>             <multicast/>
> </address>
>
>
> And test the same sequence as I described earlier:
> 1.) Start sender program first and send a message, and then start receiver.
> There is a multicast queue created after I started receiver. However, I
> couldn't located the message I send to the topic. The message count on the
> newly created multicast queue is 0. Is there a way to retrieve the message
> sent to the topic before receiver registered to the topic?
>
> 2.) Start receiver first and then start sender, now the message received
> successfully.
>
> Thanks,
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/Artemis-2-2-0-createTopic-create-an-anycast-
> when-there-is-no-consumer-created-tp4729269p4729273.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Artemis 2.2.0, createTopic create an anycast when there is no consumer created

vchen1
Yes, I agree with you and thanks a lot for answer my question.
Loading...