// latch that waits until we are complete
final CountDownLatch latch = new CountDownLatch(1);
// we should wait for the reply so install a on completion so we know when its complete
copy.addOnCompletion(new SynchronizationAdapter() {
@Override
public void onDone(Exchange response) {
// check for timeout, which then already would have invoked the latch
if (latch.getCount() == 0) {
if (log.isTraceEnabled()) {