Sun Java System Message Queue 4.2 Developer's Guide for Java Clients

Connection Events

The following table lists and describes the events that can be returned by the event listener.

Note that the JMS exception listener is not called when a connection event occurs. The exception listener is only called if the client runtime has exhausted its reconnection attempts. The client runtime always calls the event listener before the exception listener.

Table 3–5 Notification Events

Event Type 

Meaning 

ConnectionClosingEvent

The Message Queue client runtime generates this event when it receives a notification from the broker that a connection is about to be closed due to a shutdown requested by the administrator. 

ConnectionClosedEvent

The Message Queue client runtime generates this event when a connection is closed due to a broker error or when it is closed due to a shutdown or restart requested by the administrator. 

When an event listener receives a ConnectionClosedEvent, the application can use the getEventCode() method of the received event to get an event code that specifies the cause for closure.

ConnectionReconnectedEvent

The Message Queue client runtime has reconnected to a broker. This could be the same broker to which the client was previously connected or a different broker.  

An application can use the getBrokerAddress method of the received event to get the address of the broker to which it has been reconnected.

ConnectionReconnectFailedEvent

The Message Queue client runtime has failed to reconnect to a broker. Each time a reconnect attempt fails, the runtime generates a new event and delivers it to the event listener. 

The JMS exception listener is not called when a connection event occurs. It is only called if the client runtime has exhausted its reconnection attempts. The client runtime always calls the event listener before the exception listener.