use of org.apache.cxf.transport.jms.util.MessageListenerContainer in project cxf by apache.
the class JMSConduit method setupReplyDestination.
private void setupReplyDestination(Session session) throws JMSException {
if (staticReplyDestination == null) {
synchronized (this) {
if (staticReplyDestination == null) {
staticReplyDestination = jmsConfig.getReplyDestination(session);
String messageSelector = JMSFactory.getMessageSelector(jmsConfig, conduitId);
if (jmsConfig.getMessageSelector() != null) {
messageSelector += (messageSelector != null && !messageSelector.isEmpty() ? " AND " : "") + jmsConfig.getMessageSelector();
}
if (messageSelector == null && !jmsConfig.isPubSubDomain()) {
// An option for this might be a good idea for people who do not plan to share queues.
return;
}
AbstractMessageListenerContainer container;
if (jmsConfig.isOneSessionPerConnection()) {
container = new PollingMessageListenerContainer(jmsConfig, true, this);
} else {
container = new MessageListenerContainer(getConnection(), staticReplyDestination, this);
}
container.setTransactionManager(jmsConfig.getTransactionManager());
container.setTransacted(jmsConfig.isSessionTransacted());
container.setDurableSubscriptionName(jmsConfig.getDurableSubscriptionName());
container.setMessageSelector(messageSelector);
Object executor = bus.getProperty(JMSFactory.JMS_CONDUIT_EXECUTOR);
if (executor instanceof Executor) {
container.setExecutor((Executor) executor);
}
container.start();
jmsListener = container;
addBusListener();
}
}
}
}
Aggregations