daily pastebin goal
17%
SHARE
TWEET

Untitled

a guest Feb 19th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top