worker.processMessages();
}
catch (Exception e)
{
// Use this rollback method in case a transaction has not been configured on the endpoint.
RollbackSourceCallback rollbackMethod = new RollbackSourceCallback()
{
@Override
public void rollback()
{
recoverSession();
}
};
if (e instanceof MessagingException)
{
MessagingException messagingException = (MessagingException) e;
if (!messagingException.getEvent().isTransacted() && messagingException.causedRollback())
{
rollbackMethod.rollback();
}
}
else
{
getEndpoint().getMuleContext().getExceptionListener().handleException(e, rollbackMethod);