public void handleMessagingException(UMOMessage message, Throwable t) { System.out.println("@@@@ ExceptionHandler Called @@@@"); if (t instanceof MessageRedeliveredException) { countDown.countDown(); try { // MessageRedeliveredException mre = // (MessageRedeliveredException)t; Message msg = (Message) message.getPayload(); assertNotNull(msg); assertTrue(msg.getJMSRedelivered()); assertTrue(msg instanceof TextMessage); // No need to commit transaction as the Tx template will // auto // matically commit by default super.handleMessagingException(message, t); } catch (Exception e) { fail(e.getMessage()); } } else { t.printStackTrace(); fail(t.getMessage()); } super.handleMessagingException(message, t); }
public RollbackExceptionListener(CountDownLatch countDown, UMOEndpointURI deadLetter) throws UMOException { this.countDown = countDown; UMOEndpoint ep = MuleEndpoint.createEndpointFromUri(deadLetter, UMOEndpoint.ENDPOINT_TYPE_SENDER); // lets include dispatch to the deadLetter queue in the sme tx. ep.setTransactionConfig(new MuleTransactionConfig()); ep.getTransactionConfig().setAction(UMOTransactionConfig.ACTION_JOIN_IF_POSSIBLE); super.addEndpoint(ep); }