When the event is a disconnect, the exception handler can call various EMS methods without any problem. However, when the event is a fault-tolerant switchover, the exception handler is not allowed to call any EMS method. To do so risks a deadlock. You can call the
setExceptionOnFTSwitch method to receive an exception that contains the new server URL after a fault-tolerant switchover has occurred.
Implement an ExceptionListener.onException method, use the
Connection object’s
setExceptionListener method to register the exception listener, and call
Tibjms.setExceptionOnFTSwitch to call the exception handler after a fault-tolerant switchover:
See the tibjmsMsgConsumer.java sample client for a working example (without the
setExceptionOnFTSwitch call).
Define an onException function to handle exceptions, use the
tibemsConnection_SetExceptionListener function to call
onException when an error is encountered, and call
tibems_setExceptionOnFTSwitch to call the exception handler after a fault-tolerant switchover:
See the tibemsMsgConsumer.c sample client for a working example (without the
setExceptionOnFTSwitch call).
Implement an IExceptionListener.OnException method, set the
Connection object’s
ExceptionListener property to register the exception listener, and call
Tibems.SetExceptionOnFTSwitch to call the exception handler after a fault-tolerant switchover:
See the csMsgConsumer.cs sample client for a working example (without the
setExceptionOnFTSwitch call).