So here is the requirement.
The process of publishing messages into a topic should occur within a transaction
If the transaction succeeds then we return 0
- If the transaction fails then we return 1
I know how to publish messages into a topic. I am using JMS template to publish into topic.
jmsTemplate.convertAndSend(topic, event);
But how can I make sure this is within a transaction? Can someone use code and explain the above requirement?
I have searched similar questions for a possible solution to my query, but they are not the ones which resolves my issue. Please do not point to other answers.