4 Replies Latest reply on Mar 1, 2012 12:00 PM by wblackburn4

    Clarification on client-reconnect in non-HA standalone HornetQ 2.2.5

    wblackburn4

      I have a single instance of standalone HornetQ serving several JMS clients. I use the local JNDI server to configure connection fatories and retrieve them during startup. The clients create a connection and a session, keeping both open and using javax.jms.MessageListener implementations to consume messages. Connections have these attributes:

       

      <retry-interval>1000</retry-interval>

      <retry-interval-multiplier>1.5</retry-interval-multiplier>

      <max-retry-interval>60000</max-retry-interval>

      <reconnect-attempts>1000</reconnect-attempts>

       

      If I restart HornetQ, my clients do not reconnect - I assume I am doing something wrong, but as I study the documentation I seem to see a contradiction, specifically:

       

      "Alternatively, the server might have actually been restarted after crashing or being stopped. In this case any sessions will no longer be existent on the server and it won't be possible to 100% transparently re-attach to them.

       

      "In this case, HornetQ will automatically reconnect the connection and recreate any sessions and consumers on the server corresponding to the sessions and consumers on the client. This process is exactly the same as what happens during failover onto a backup server."

       

      This seems to imply that reconnection should be automatic. But if I read further on, I see:

       

      "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 won't be able to re-attach, and any ExceptionListener or FailureListener instances registered on the connection or session will be called."

       

      Which seems to imply that I must manually code such reconnection logic.

       

      Can you please clarify what I should expect HoretQ to handle automatically, and what I must code into application logic?

       

      Thank you.