* @return resolved destination
*/
protected static Destination resolveOrCreateDestination(final JmsTemplate jmsTemplate,
final String replyToDestinationName,
final boolean pubSubDomain) {
return (Destination)jmsTemplate.execute(new SessionCallback() {
public Object doInJms(Session session) throws JMSException {
if (replyToDestinationName == null) {
if (session instanceof QueueSession) {
// For JMS 1.0.2
return ((QueueSession)session).createTemporaryQueue();