How to find out if JMS Connection is there?

前端 未结 4 1658
生来不讨喜
生来不讨喜 2020-12-15 18:47

In JMS it is easy to find out if a connection is lost, a exception happens. But how do I find out if the connection is there again?

Scenario: I use JMS to communicat

4条回答
  •  别那么骄傲
    2020-12-15 19:22

    JMS spec does not describe any transport protocol, it does not say anything about connections (i.e. should broker keep them alive or establish a new connection for every session). So, I think what you mean by

    Now my connection breaks (server is down), which results in a exception.

    is that you are trying to send a message and you are getting a JmsException.

    I think, the only way to see if broker is up is to try to send a message.

提交回复
热议问题