// the write operation is asynchronous. Use WriteFuture to wait until the session has been written
WriteFuture future = session.write(body);
// must use a timeout (we use 10s) as in some very high performance scenarios a write can cause
// thread hanging forever
LOG.trace("Waiting for write to complete for body: {} using session: {}", body, session);
future.join(10000L);
if (!future.isWritten()) {
throw new CamelExchangeException("Cannot write body: " + body + " using session: " + session, exchange);
}
}