...
Advanced examples (CXF >= 3)
- Performance and pooling
- JMS reconnect functionalityJMS transactionstransactions
Reconnect functionality
The JMS transport automatically reconnects when any JMS exceptions happen. The first exception will be logged with "Exception on JMS connection. Trying to reconnect" and the exception details.
Then CXF will try to reconnect every 5 seconds and log "Exception on reconnect. Trying again, attempt num x".
In conduits every exception when sending a message will be thrown to the caller. The conduit then closes the connection and will start a new one when sending the next message.
Warning | ||
---|---|---|
| ||
When using pooling make sure the pool throws away the Connection in case of errors. In ActiveMQ PooledConnection this can be achieved using setExpiryTimeout(milliseconds). |
In CXF 2.x the JMS server must be present before JMS endpoints are started. In cxf 3 the endpoint will start and periodically reconnect like in the case of an exception while running.