You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by ldebello <lu...@hotmail.com> on 2019/03/15 21:03:27 UTC

Cluster + Redistribution

Hi,

I would like to know if someone knows if there is any difference between
doing message redistribution in cluster using the CORE protocol or AMQP
protocol, because I am having some issues switching from CORE to AMQP where
the cluster is seems not doing the redistribution.

Thanks & Best Regards,
Luis



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

Re: Cluster + Redistribution

Posted by ldebello <lu...@hotmail.com>.
That is good to know, but I am not sure is that is the final explanation
because client send messages to one anycast address then there is a divert
using a bridge to other broker to one anycast address and that broker does a
divert to a address with multicast. 

Thanks and regards,
Luis



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

Re: Cluster + Redistribution

Posted by Justin Bertram <jb...@apache.org>.
The core JMS client sets the routing-type of the message automatically
based on what kind of destination it's working with (i.e. ANYCAST for
queues & MULTICAST for topics). That explains the discrepancy.


Justin

On Fri, Mar 22, 2019 at 7:51 AM ldebello <lu...@hotmail.com> wrote:

> Sorry for the delay,
>
> This is a springboot project which use the jmsTemplate, I didn't debug to
> check if there is some property set inside this code but the change was the
> following.
>
> First Version: We used artemis-client (2.5.0) connecting to the following
> uri tcp://localhost:5672.
> Second Version: We removed artemis-client and start using qpid (0.40.0)
> client connecting to the following uri: amqps://localhost:5672
>
> In the first case we got a CoreMessage with routing type null and in the
> second case the we got a AMQMessage with routing type ANYCAST. we didnt set
> any routing type by code, but as I mentioned before I didn't debug the jms
> template to confirm if maybe this adding some properties.
>
> Anyway adding routingtype in the divert config solve this case.
>
> Regards,
> Luis
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>

Re: Cluster + Redistribution

Posted by ldebello <lu...@hotmail.com>.
Sorry for the delay,

This is a springboot project which use the jmsTemplate, I didn't debug to
check if there is some property set inside this code but the change was the
following.

First Version: We used artemis-client (2.5.0) connecting to the following
uri tcp://localhost:5672.
Second Version: We removed artemis-client and start using qpid (0.40.0)
client connecting to the following uri: amqps://localhost:5672

In the first case we got a CoreMessage with routing type null and in the
second case the we got a AMQMessage with routing type ANYCAST. we didnt set
any routing type by code, but as I mentioned before I didn't debug the jms
template to confirm if maybe this adding some properties.

Anyway adding routingtype in the divert config solve this case.

Regards,
Luis



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

Re: Cluster + Redistribution

Posted by Justin Bertram <jb...@apache.org>.
How are you sending the core messages? Are you using the core JMS client or
are you sending them directly using the core API? If the latter, are you
setting the routing-type on the message?


Justin

On Sun, Mar 17, 2019 at 11:36 PM ldebello <lu...@hotmail.com> wrote:

> After more debugging I was able to find a "fix" for this. In my config I
> have
> one divert from one queue of anycast to another with multicast.
>
> So I have added "<routing-type>MULTICAST</routing-type>" for my divert and
> that solve the issue. However I continue thinking there is something weird
> or wrong because this issue does not happens with CORE messages but yes
> with
> AMQP messages.
>
> I hope this help someone else if they are in this situation.
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>

Re: Cluster + Redistribution

Posted by ldebello <lu...@hotmail.com>.
After more debugging I was able to find a "fix" for this. In my config I have
one divert from one queue of anycast to another with multicast. 

So I have added "<routing-type>MULTICAST</routing-type>" for my divert and
that solve the issue. However I continue thinking there is something weird
or wrong because this issue does not happens with CORE messages but yes with
AMQP messages.

I hope this help someone else if they are in this situation.



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

Re: Cluster + Redistribution

Posted by ldebello <lu...@hotmail.com>.
After some debugging I was able to understand the problem and I think this is
an issue in the broker logic.

Let me try to explain the case:

*Infra:*
Broker 1
Broker 2
Broker 3

Broker 1 use a core bridge to Broker 2.
Broker 2 and 3 create a cluster of 2 nodes.

*Participants:*
1 Producer
1 Consumer

*Scenarios:*

Scenario 1:

Consumer consuming message in Broker 2 or 3 for this case is the same.
Producer send a *CORE* Message to Broker 1 this do a forward to Broker 2. So
if the Consumer is in Broker 2 gets the message and if the consumer is in
Broker 3, redistribution works as expected and also get the message

Scenario 2:

Consumer consuming message in Broker 2.
Producer send a AMQP Message to Broker 1 this do a forward to Broker 2.
Given the fact Consumer is in Broker 2 everything works as expected.

Scenario 3:

Consumer consuming message in Broker 3.
Producer send a AMQP Message to Broker 1 this do a forward to Broker 2.
Given the fact Consumer is in Broker 3 the message never reaches the
consumer

*Analysis*

After some debugging I was able to find the reason for this and the message
never reaches the consumer because the following code does not return true
in the IF clause

@Override
   public void route(final Message message, final RoutingContext context)
throws Exception {
      if (isMatchRoutingType(context)) {
         queue.route(message, context);
      }
   }

If seems for Core message the RoutingType is null but for AMQP message the
routing type returns ANYCAST, and my Queue is MULTICAST so the message never
arrays. The following message is shown in the logs "is not going anywhere as
it didn't have a binding on address:BridgeNotifications"

In the case where the consumer is in Broker 2 this works because the routing
type is still null because the workflow is a little different.

*Status*

I totally understand the scenario can be complex and test would be ideal so
I would like your help pointing me out some classes using CORE Message and
AMQP message to create and automatic tests. Also using Bridges so I can
create a test in a fastest way instead of browsing the code.


Thanks and Regards,
Luis




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