32.3. Configuring reconnection/reattachment attributes

If you are using JMS and the JMS Service on the server is being used to load your JMS connection factory instances into JNDI, you can specify these parameters in JBOSS_DIST/jboss-as/server/<PROFILE>/deploy/hornetq/hornetq-jms.xml like so:
<connection-factory name="NettyConnectionFactory">
   <xa>true</xa>
   <connectors>
      <connector-ref connector-name="netty"/>
   </connectors>
   <entries>
      <entry name="/ConnectionFactory"/>
      <entry name="/XAConnectionFactory"/>
   </entries>
</connection-factory>

If you are using JMS, but instantiating your JMS connection factory directly, you can specify the parameters using the appropriate setter methods on the HornetQConnectionFactory immediately after its creation.
If you are using the core API and instantiating the ClientSessionFactory instance directly, you can also specify the parameters using the appropriate setter methods on the ClientSessionFactory immediately after its creation.
If your client does manage to reconnect but the session is no longer available on the server, for instance if the server has been restarted or it has timed out, then the client will be unable to re-attach, and any ExceptionListener or SessionFailureListener instances registered on the connection or session will be called.

Note

Registered JMS ExceptionListener or Core SessionFailureListener instances are called when a client reconnects or re-attaches.