JBoss AMQ .Net Client approach for failover

420 Views Asked by At

Red Hat recommends using AMQPNetLite by Azure team as the client to connect to JBoss AMQ when connecting to the broker from .Net based applications - https://access.redhat.com/documentation/en-us/red_hat_amq/7.0/html-single/using_the_amq_.net_client/index

JBoss AMQ is based on Apache Artemis, which supports automatic failover handling for clients - https://activemq.apache.org/artemis/docs/1.0.0/ha.html#failover-mode but it appears this transparent failover handling by the client is for JMS API and not the .Net API.

AMQPNetLite doesn't seem to automatically handle failovers - https://github.com/Azure/amqpnetlite/issues/33#issuecomment-144798871

What is the recommendation from Red Hat, or any documented procedure for .Net clients to handle failover correctly? Is there an in-built mechanism or does this have to be hand coded?

Will any exceptions be raised during such failover so the client can identify that failover has occured and the backup server is not the live server?

2

There are 2 best solutions below

3
On BEST ANSWER

How failover is handled depends on the client. Apache Artemis ships its own client which handles failover according to the documentation you linked. The AMQPNetLite client isn't shipped with the broker and is therefore 100% independent. Based on the linked AMQPNetLite issue it appears that it doesn't support failover. For further information I recommend you ask the AMQPNetLite community about this (i.e. use their tags rather than broker tags like activemq-artemis & jboss-amq).

0
On

If you don't want to implement this yourself using AmqpNetLite you can try community driven ArtemisNetClient. It is built on top of AmqpNetLite, and has the Automatic Recovery feature built in --> https://havret.github.io/dotnet-activemq-artemis-client/docs/auto-recovery