Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void onMessage(Message message) {
- String msg = null;
- try
- {
- msg = receiveMessage(message);
- // other code to insert message in db
- message.acknowledge();
- if(true)
- {
- throw new NullPointerException("npe"));
- }
- ** // other code which might produces null pointer exception **
- }
- catch(Exception ex){}
- }
- <jms:listener-container container-type="default" connection-factory="calendarConnectionFactory"
- acknowledge="transacted" destination-type="queue" cache="consumer" concurrency="1-5">
- <jms:listener destination="${jms.calendar.destination}" ref="calendarListener"/>
- </jms:listener-container>
- @Override
- @Transactional(propagation = Propagation.REQUIRED,
- noRollbackFor = {ClassCastException.class, IllegalArgumentException.class})
- public void onMessage(Message message) {
- ....
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement