You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Ogi <as...@gmail.com> on 2018/01/26 11:15:08 UTC

[ARTEMIS] Messages with same group-id are received by multiple consumers

I have two deployed apps, one on my local machine and one on the server and
both apps are communicating through the same Artemis client which is
installed on the server. Artemis version is 1.5.5. Problem occurs when I
execute simple test that sends 1000 messages divided into multiple groups,
in this case 50 groups (numbers are not important, it happens no matter the
number of messages or groups) from the server app. Local app consumer
receives every group and almost all messages. It's because server app
consumer receives for example only one message from let's say group number 5
and that behavior is repeated in multiple groups. 

Why is this happening, am I missing something ? Again, both consumers and
producers are working on same Artemis.

Thank you in advance,
Ognjen



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: [ARTEMIS] Messages with same group-id are received by multiple consumers

Posted by Miroslav Novak <mn...@redhat.com>.
I don't know Spring boot but I suspect that .war in Wildfly-11-0 is servlet which is triggered periodically to consume messages. The problem might be that this server app with consumer is invoked periodically, consumer starts to read messages from queue and then closes. After closing consumer message groups are assigned to another consumer (in this case to consumer from local app). This would explain why this consumer does not get (almost) any messages.

Mirek

----- Original Message -----
> From: "Ogi" <as...@gmail.com>
> To: users@activemq.apache.org
> Sent: Monday, January 29, 2018 11:17:53 AM
> Subject: Re: [ARTEMIS] Messages with same group-id are received by multiple consumers
> 
> Thing I forgot to mention: Both apps are Spring boot apps, but server app is
> deployed as a .war file in Wildfly-11-0 and local app is started using
> Spring boot's "bootRun" task.
> 
> 
> 
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
> 

Re: [ARTEMIS] Messages with same group-id are received by multiple consumers

Posted by Ogi <as...@gmail.com>.
Thing I forgot to mention: Both apps are Spring boot apps, but server app is
deployed as a .war file in Wildfly-11-0 and local app is started using
Spring boot's "bootRun" task.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: [ARTEMIS] Messages with same group-id are received by multiple consumers

Posted by Ogi <as...@gmail.com>.
Hi Mirek,

Thank you for your answer, but no, unfortunately  that is not the case. So,
use case is: I first start server app, then my local app, so the consumers
are firstly connected to the Artemis. And after everything is up, I execute
that simple test.

Thank you,
Ognjen



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: [ARTEMIS] Messages with same group-id are received by multiple consumers

Posted by Miroslav Novak <mn...@redhat.com>.
Hi Ognjen,

I believe the issue is that messages are sent to Artemis first and then consumers connect, right? In this case first consumer will get all or most of the message groups assigned. Could you try to first connect consumers and then send messages?

I think that ActiveMQ 5.x had better logic in this that waited for some time give chance to all consumers connect and then "load-balanced" message groups across consumers. I'm not sure if there is Artemis feature request jira for similar behavior.

Thanks,
Mirek

----- Original Message -----
> From: "Ogi" <as...@gmail.com>
> To: users@activemq.apache.org
> Sent: Friday, January 26, 2018 12:15:08 PM
> Subject: [ARTEMIS] Messages with same group-id are received by multiple consumers
> 
> I have two deployed apps, one on my local machine and one on the server and
> both apps are communicating through the same Artemis client which is
> installed on the server. Artemis version is 1.5.5. Problem occurs when I
> execute simple test that sends 1000 messages divided into multiple groups,
> in this case 50 groups (numbers are not important, it happens no matter the
> number of messages or groups) from the server app. Local app consumer
> receives every group and almost all messages. It's because server app
> consumer receives for example only one message from let's say group number 5
> and that behavior is repeated in multiple groups.
> 
> Why is this happening, am I missing something ? Again, both consumers and
> producers are working on same Artemis.
> 
> Thank you in advance,
> Ognjen
> 
> 
> 
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>