You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Thorsten Kunz <th...@masergy.com> on 2021/06/06 08:09:40 UTC

Artemis: unclear connection parameter for cluster reconnects

Hi there,

I have a question about reconnecting to a cluster. So my goal is if I have
a cluster with 3 nodes A,B and C to make the Artemis client connect to A
and if that connection dies - maybe because node A was shutdown for
maintenance - it would reconnect to node B. If B goes down it will try to
connect to C and if that is down it should try A again, etc. The client
should actually try this without ever giving up.
Now I always thought that this would be achieved with the
"reconnectAttempts=-1" URL parameter. But I recently stumbled over
documentation that suggested that this would only work with "ha=true" as
well. But since I have a cluster without HA nodes I do not have that
parameter set.

So now I wonder if what I am doing is actually correct or what URL
parameters I actually need to set to get my desired behaviour? It actually
doesn't matter to me if the client is trying the servers round robin or
random as long as it does actually try to reconnect indefinitely to all
cluster members in case of failure of the current one.

Thanks,

Thorsten

Re: Artemis: unclear connection parameter for cluster reconnects

Posted by Thorsten Kunz <th...@masergy.com>.
Thanks Domenico,

well I am trying to get the same behaviour for the Artemis client that used
to be available in the ActiveMQ client: ActiveMQ (apache.org)
<https://activemq.apache.org/failover-transport-reference>

There the "failover:" prefix used to provide exactly the functionality I am
looking for. Is there really no way to achieve the same thing with the
artemis client for a cluster? I guess "ha=true&reconnectAttempts=-1" would
achieve the same behaviour but only for a backup HA group setup and not for
a plain set of cluster nodes without backup groups?

So if this is true then I have the following two option:
a) switch from a cluster setup to active/passive HA setup
b) switch to another client implementation like ActiveMQ of Qpid JMS that
supports the "failover:" feature

Since I don't think that a) is going to be an option I'll have to go with
c) and potentially open another can of worms. :(

I would love to hope for option c) that the "failover:" feature would get
ported to the artemis client but if it hasn't happened yet I guess folks
are not going to be doing it any time soon?

Thanks

Thorsten


On Tue, Jun 8, 2021 at 11:25 AM Domenico Francesco Bruscino <
bruscinodf@gmail.com> wrote:

> Hi Torsten,
>
> Artemis clients can be configured to automatically reconnect to the same
> server[1] or the relative backup server when it takes over[2].
> The `ha` parameter is just to enable the clients to reconnect to the backup
> server, when it detects a connection failure with the live server[3].
>
> AFAIK there is no parameter to automatically reconnect to other cluster
> servers without High Availability[2].
>
> [1]
>
> https://activemq.apache.org/components/artemis/documentation/latest/client-reconnection.html
> [2]
> https://activemq.apache.org/components/artemis/documentation/latest/ha.html
> [3]
>
> https://activemq.apache.org/components/artemis/documentation/latest/ha.html#automatic-client-failover
>
> Regards,
> Domenico
>
>
>
> On Sun, 6 Jun 2021 at 10:10, Thorsten Kunz <th...@masergy.com>
> wrote:
>
> > Hi there,
> >
> > I have a question about reconnecting to a cluster. So my goal is if I
> have
> > a cluster with 3 nodes A,B and C to make the Artemis client connect to A
> > and if that connection dies - maybe because node A was shutdown for
> > maintenance - it would reconnect to node B. If B goes down it will try to
> > connect to C and if that is down it should try A again, etc. The client
> > should actually try this without ever giving up.
> > Now I always thought that this would be achieved with the
> > "reconnectAttempts=-1" URL parameter. But I recently stumbled over
> > documentation that suggested that this would only work with "ha=true" as
> > well. But since I have a cluster without HA nodes I do not have that
> > parameter set.
> >
> > So now I wonder if what I am doing is actually correct or what URL
> > parameters I actually need to set to get my desired behaviour? It
> actually
> > doesn't matter to me if the client is trying the servers round robin or
> > random as long as it does actually try to reconnect indefinitely to all
> > cluster members in case of failure of the current one.
> >
> > Thanks,
> >
> > Thorsten
> >
>


-- 

<http://www.masergy.com> <https://www.masergy.com>
<https://www.masergy.com>[image:
Masergy Logo] <https://www.masergy.com>

Thorsten Kunz

Software Architect

p: 3108957480

<https://www.linkedin.com/ADDYOURIDHERE/>
<https://www.linkedin.com/company/16604/>
<https://www.linkedin.com/company/16604/>[image: LinkedIn]
<https://www.linkedin.com/company/16604/>
<https://www.twitter.com/ADDYOURTWITTERHANDLE>
<https://twitter.com/masergy>[image:
Twitter] <https://twitter.com/masergy>

Re: Artemis: unclear connection parameter for cluster reconnects

Posted by Domenico Francesco Bruscino <br...@gmail.com>.
Hi Torsten,

Artemis clients can be configured to automatically reconnect to the same
server[1] or the relative backup server when it takes over[2].
The `ha` parameter is just to enable the clients to reconnect to the backup
server, when it detects a connection failure with the live server[3].

AFAIK there is no parameter to automatically reconnect to other cluster
servers without High Availability[2].

[1]
https://activemq.apache.org/components/artemis/documentation/latest/client-reconnection.html
[2]
https://activemq.apache.org/components/artemis/documentation/latest/ha.html
[3]
https://activemq.apache.org/components/artemis/documentation/latest/ha.html#automatic-client-failover

Regards,
Domenico



On Sun, 6 Jun 2021 at 10:10, Thorsten Kunz <th...@masergy.com>
wrote:

> Hi there,
>
> I have a question about reconnecting to a cluster. So my goal is if I have
> a cluster with 3 nodes A,B and C to make the Artemis client connect to A
> and if that connection dies - maybe because node A was shutdown for
> maintenance - it would reconnect to node B. If B goes down it will try to
> connect to C and if that is down it should try A again, etc. The client
> should actually try this without ever giving up.
> Now I always thought that this would be achieved with the
> "reconnectAttempts=-1" URL parameter. But I recently stumbled over
> documentation that suggested that this would only work with "ha=true" as
> well. But since I have a cluster without HA nodes I do not have that
> parameter set.
>
> So now I wonder if what I am doing is actually correct or what URL
> parameters I actually need to set to get my desired behaviour? It actually
> doesn't matter to me if the client is trying the servers round robin or
> random as long as it does actually try to reconnect indefinitely to all
> cluster members in case of failure of the current one.
>
> Thanks,
>
> Thorsten
>