restartConnection();
}
});
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Destination destination = jmsConfig.getTargetDestination(session);
AbstractMessageListenerContainer container = jmsConfig.getTransactionManager() != null
? new PollingMessageListenerContainer(connection, destination, this)
: new MessageListenerContainer(connection, destination, this);
container.setTransactionManager(jmsConfig.getTransactionManager());
container.setMessageSelector(jmsConfig.getMessageSelector());
container.setTransacted(jmsConfig.isSessionTransacted());
container.setDurableSubscriptionName(jmsConfig.getDurableSubscriptionName());
Executor executor = JMSFactory.createExecutor(bus, "jms-destination");
container.setExecutor(executor);
container.start();
suspendedContinuations.setListenerContainer(container);
connection.start();
return container;
} catch (JMSException e) {
throw JMSUtil.convertJmsException(e);