mirror of https://github.com/apache/activemq.git
use the same ConnectionFactory so that transactional consume + send can use the same session
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@574465 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5829d7045c
commit
696b34a01d
|
@ -46,30 +46,12 @@ public class ActiveMQConfiguration extends JmsConfiguration {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActiveMQConnectionFactory getListenerConnectionFactory() {
|
||||
return (ActiveMQConnectionFactory) super.getListenerConnectionFactory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setListenerConnectionFactory(ConnectionFactory listenerConnectionFactory) {
|
||||
if (listenerConnectionFactory instanceof ActiveMQConnectionFactory) {
|
||||
super.setListenerConnectionFactory(listenerConnectionFactory);
|
||||
}
|
||||
else {
|
||||
throw new IllegalArgumentException("ConnectionFactory " + listenerConnectionFactory
|
||||
+ " is not an instanceof " + ActiveMQConnectionFactory.class.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ConnectionFactory createListenerConnectionFactory() {
|
||||
protected ConnectionFactory createConnectionFactory() {
|
||||
ActiveMQConnectionFactory answer = new ActiveMQConnectionFactory();
|
||||
if (answer.getBeanName() == null) {
|
||||
answer.setBeanName("Camel");
|
||||
}
|
||||
answer.setBrokerURL(getBrokerURL());
|
||||
return answer;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ConnectionFactory createTemplateConnectionFactory() {
|
||||
return new PooledConnectionFactory(getListenerConnectionFactory());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue