1

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?

Praveen Nayak
  • 167
  • 1
  • 16

2 Answers2

1

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).

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
  • One addition - AMQP.Net Lite has example program showing how reconnect can be implemented: https://github.com/Azure/amqpnetlite/blob/master/Examples/Reconnect/ReconnectSender/ReconnectSender.cs – Justin Ross Aug 22 '18 at 00:17
  • Does Artemis or JBoss AMQ ship a .Net library (earlier version shipped an ActiveMQ.NMS library which is deprecated now) that can be used instead, which works more closely with AMQ? I chose AMQPNetLite primarily due to Red Hat recommendation. If the recommendation is this tool, would there be different exceptions raised to distinguish temporary connection loss from server failover, so a client can know to retry or connect to the failover server, or maybe there is a procedure to follow? – Praveen Nayak Aug 22 '18 at 14:03
  • Artemis doesn't ship a .NET client. JBoss AMQ is a commercial product so it's probably best to work with the vendor directly to understand what clients they may provide and what the behavior of those clients may be. – Justin Bertram Aug 22 '18 at 15:23
1

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

Hav
  • 870
  • 8
  • 17