Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. public void onMessage(Message message) {
  2. String msg = null;
  3. try
  4. {
  5. msg = receiveMessage(message);
  6.  
  7. // other code to insert message in db
  8.  
  9. message.acknowledge();
  10.  
  11. if(true)
  12. {
  13. throw new NullPointerException("npe"));
  14. }
  15. ** // other code which might produces null pointer exception **
  16. }
  17. catch(Exception ex){}
  18. }
  19.  
  20. <jms:listener-container container-type="default" connection-factory="calendarConnectionFactory"
  21. acknowledge="transacted" destination-type="queue" cache="consumer" concurrency="1-5">
  22. <jms:listener destination="${jms.calendar.destination}" ref="calendarListener"/>
  23. </jms:listener-container>
  24.  
  25. @Override
  26. @Transactional(propagation = Propagation.REQUIRED,
  27. noRollbackFor = {ClassCastException.class, IllegalArgumentException.class})
  28. public void onMessage(Message message) {
  29. ....
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement