Transactions, Spring.
process(ENTITY, MESSAGE) { TransactionTemplate transactionTemplate = new TransactionTemplate(transactionManager); transactionTemplate.executeWithoutResult(status -> { entityManager.persist(ENTITY); jmsTemplate.convertAndSend(DESTINATION, MESSAGE); }); } So, as we can see, we have to create a