CleverBus OpenHub uses Apache Camel events concept:
...
Code Block |
---|
/** * Helper class for creating events. */ public final class TutanEventHelperCustomEventHelper { private TutanEventHelperCustomEventHelper() { } /** * Throws {@link FailedFromVfEvent} and notifies all registered event notifiers. * * @param exchange the exchange */ public static void notifyFailedFromVf(Exchange exchange) { AsynchEventHelper.notifyMsg(exchange, new EventNotifierCallback() { @Override public boolean ignore(EventNotifier notifier) { return notifier.isIgnoreExchangeEvents() || notifier.isIgnoreExchangeCompletedEvent(); } @Override public AbstractAsynchEvent createEvent(Exchange exchange) { return new FailedFromVfEvent(exchange, getMsgFromExchange(exchange)); } }); } private static Message getMsgFromExchange(Exchange exchange) { return (Message) exchange.getIn().getHeader(AsynchConstants.MSG_HEADER); } } |
...