@Test public void sendsTxAbortedEventOnError() throws Exception { interceptor.onError(parentTxId, compensationMethod, new RuntimeException("oops")); TxEvent event = messages.get(0); assertThat(event.globalTxId(), is(globalTxId)); assertThat(event.localTxId(), is(localTxId)); assertThat(event.parentTxId(), is(parentTxId)); assertThat(event.type(), is(EventType.TxAbortedEvent)); assertThat(event.compensationMethod(), is(compensationMethod)); }
@Override public void onError(String parentTxId, String compensationMethod, Throwable throwable) { sender.send( new TxAbortedEvent(context.globalTxId(), context.localTxId(), parentTxId, compensationMethod, context.category(), throwable)); }
CompensableInterceptor implements EventAwareInterceptor { @Override public void onError(String parentTxId, String compensationMethod, Throwable throwable) { sender.send( new TxAbortedEvent(context.globalTxId(), context.localTxId(), parentTxId, compensationMethod, context.category(), throwable)); } }
CompensableInterceptor implements EventAwareInterceptor { @Override public void onError(String parentTxId, String compensationMethod, Throwable throwable) { sender.send( new TxAbortedEvent(context.globalTxId(), context.localTxId(), parentTxId, compensationMethod, context.category(), throwable)); } CompensableInterceptor(OmegaContext context, MessageSender sender); }
CompensableInterceptor implements EventAwareInterceptor { @Override public void onError(String parentTxId, String compensationMethod, Throwable throwable) { sender.send( new TxAbortedEvent(context.globalTxId(), context.localTxId(), parentTxId, compensationMethod, context.category(), throwable)); } CompensableInterceptor(OmegaContext context, MessageSender sender); @Override AlphaResponse preIntercept(String parentTxId, String compensationMethod, int timeout, String retriesMethod,
      int retries, Object... message); @Override void postIntercept(String parentTxId, String compensationMethod); @Override void onError(String parentTxId, String compensationMethod, Throwable throwable); }
CompensableInterceptor implements EventAwareInterceptor { @Override public void onError(String parentTxId, String compensationMethod, Throwable throwable) { sender.send( new TxAbortedEvent(context.globalTxId(), context.localTxId(), parentTxId, compensationMethod, context.category(), throwable)); } CompensableInterceptor(OmegaContext context, MessageSender sender); @Override AlphaResponse preIntercept(String parentTxId, String compensationMethod, int timeout, String retriesMethod,
      int retries, Object... message); @Override void postIntercept(String parentTxId, String compensationMethod); @Override void onError(String parentTxId, String compensationMethod, Throwable throwable);  }