boolean sync;
if (data.redeliverFromSync) {
// this redelivery task was scheduled from synchronous, which we forced to be asynchronous from
// this error handler, which means we have to invoke the callback with false, to have the callback
// be notified when we are done
sync = outputAsync.process(exchange, new AsyncCallback() {
public void done(boolean doneSync) {
log.trace("Redelivering exchangeId: {} done sync: {}", exchange.getExchangeId(), doneSync);
// mark we are in sync mode now
data.sync = false;
// only process if the exchange hasn't failed
// and it has not been handled by the error processor
if (isDone(exchange)) {
callback.done(false);
return;
}
// error occurred so loop back around which we do by invoking the processAsyncErrorHandler
processAsyncErrorHandler(exchange, callback, data);
}
});
} else {
// this redelivery task was scheduled from asynchronous, which means we should only
// handle when the asynchronous task was done
sync = outputAsync.process(exchange, new AsyncCallback() {
public void done(boolean doneSync) {
log.trace("Redelivering exchangeId: {} done sync: {}", exchange.getExchangeId(), doneSync);
// this callback should only handle the async case
if (doneSync) {