You can prevent rollbacks for specific exceptions in a Spring JMS listener with sessionTransacted(true) :
1. Catch Exception in Listener method using try catch block.
2. Use customer error handling
3 .Also you can send invalid messages that don't want retry in Dead Letter Queue.