Buscar este blog

domingo, 29 de noviembre de 2015

JBoss EAP 6.2 Domain - HornetQ Cluster - Configure ConnectionFactory

I need that a standalone client app send messages to a queue in a JBoss EAP 6.X domain. This domain have multiple nodes and, if one of those nodes crash, the client could keep sending messages to the others.

I will try to dig a little deeper in the future, but for now, this is the change I made in the Remote Connection Factory configuration.

<connection-factory name="RemoteConnectionFactory">   
 <discovery-group-ref discovery-group-name="dg-group1"/>
 <entries>
  <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>
 </entries>
 <ha>true</ha>
 <block-on-acknowledge>true</block-on-acknowledge>
 <retry-interval>1000</retry-interval>
 <retry-interval-multiplier>1.0</retry-interval-multiplier>
 <reconnect-attempts>-1</reconnect-attempts>
</connection-factory>

The key is to reference the discovery group instead the connector.

And here the CLI:
/subsystem=messaging/hornetq-server=default/connection-factory=RemoteConnectionFactory:add(discovery-group-name=dg-group1, entries= ["java:jboss/exported/jms/RemoteConnectionFactory"], ha=true, block-on-acknowledge=true, retry-interval=1000, retry-interval-multiplier=1.0, reconnect-attempts=-1)

No hay comentarios:

Publicar un comentario