.addLabels(BehaviorLabel.TRANSIENT.label());
}
}
private void sendInternal() {
ServiceDomain domain = ((SwitchYardCamelContext) _exchange.getContext()).getServiceDomain();
ExchangePhase sendPhase = getPhase();
// Publish exchange initiation event
if (ExchangePhase.IN.equals(getPhase())) {
getContext().setProperty(ExchangeInitiatedEvent.EXCHANGE_INITIATED_TIME, Long.toString(System.nanoTime()), Scope.EXCHANGE)
.addLabels(BehaviorLabel.TRANSIENT.label());
domain.getEventPublisher().publish(new ExchangeInitiatedEvent(this));
}
_exchange.getProperty(DISPATCHER, ExchangeDispatcher.class).dispatch(this);
if (isDone(sendPhase)) {
// Publish exchange completion event
long duration = System.nanoTime() - _exchange.getProperty(ExchangeInitiatedEvent.EXCHANGE_INITIATED_TIME, 0, Long.class);
getContext().setProperty(ExchangeCompletionEvent.EXCHANGE_DURATION, TimeUnit.NANOSECONDS.toMillis(duration))
.addLabels(BehaviorLabel.TRANSIENT.label());
domain.getEventPublisher().publish(new ExchangeCompletionEvent(this));
}
}