replyToDestination = permanentReplyToDestination;
} else {
if (destination instanceof Queue) {
replyToDestination = session.createTemporaryQueue();
} else {
replyToDestination = session.createTemporaryTopic();
}
}
MessageConsumer consumer = session.createConsumer(replyToDestination);
msg.setJMSCorrelationID(exchange.getExchangeId());
msg.setJMSReplyTo(replyToDestination);