//need to propagate any exceptions back to Spring container
//so transactions can occur
if (inMessage.getContent(Exception.class) != null && session != null) {
PlatformTransactionManager m = jmsConfig.getTransactionManager();
if (m != null) {
TransactionStatus status = m.getTransaction(null);
JmsResourceHolder resourceHolder =
(JmsResourceHolder) TransactionSynchronizationManager
.getResource(jmsConfig.getConnectionFactory());
boolean trans = resourceHolder == null
|| !resourceHolder.containsSession(session);
if (status != null && !status.isCompleted() && trans) {
Exception ex = inMessage.getContent(Exception.class);
if (ex.getCause() instanceof RuntimeException) {
throw (RuntimeException)ex.getCause();
} else {
throw new RuntimeException(ex);