ARTEMIS-525 Interrupted Thread should throw JMS Exceptions over the JMS layer

This commit is contained in:
Clebert Suconic 2016-05-17 19:33:36 -04:00
parent 3e2adf123b
commit a75bd7630a
1 changed files with 6 additions and 0 deletions

View File

@ -218,6 +218,7 @@ public final class ActiveMQMessageConsumer implements QueueReceiver, TopicSubscr
jmsMsg.doBeforeReceive();
}
catch (IndexOutOfBoundsException ioob) {
((ClientSessionInternal)session.getCoreSession()).markRollbackOnly();
// In case this exception happen you will need to know where it happened.
// it has been a bug here in the past, and this was used to debug it.
// nothing better than keep it for future investigations in case it happened again
@ -240,6 +241,11 @@ public final class ActiveMQMessageConsumer implements QueueReceiver, TopicSubscr
return jmsMsg;
}
catch (ActiveMQException e) {
((ClientSessionInternal)session.getCoreSession()).markRollbackOnly();
throw JMSExceptionHelper.convertFromActiveMQException(e);
}
catch (ActiveMQInterruptedException e) {
((ClientSessionInternal)session.getCoreSession()).markRollbackOnly();
throw JMSExceptionHelper.convertFromActiveMQException(e);
}
}