if (exchange instanceof InOnly || exchange instanceof RobustInOnly) {
producer.send(msg);
} else if (exchange instanceof InOut) {
Destination replyToDestination;
if (destination instanceof Queue) {
replyToDestination = session.createTemporaryQueue();
} else {
replyToDestination = session.createTemporaryTopic();
}
MessageConsumer consumer = session.createConsumer(replyToDestination);
msg.setJMSCorrelationID(exchange.getExchangeId());