I have a sample app demo working with:
- Spring Framework
4.2.5
- ActiveMQ
5.13.3
I have the following:
@Bean(name="connectionFactory")
public CachingConnectionFactory cachingConnectionFactory(ActiveMQConnectionFactory selectedActiveMQConnectionFactory) throws JMSException{
CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory();
cachingConnectionFactory.setClientId("ManolitoActiveMQ");
cachingConnectionFactory.setTargetConnectionFactory(selectedActiveMQConnectionFactory);
cachingConnectionFactory.setSessionCacheSize(10);
cachingConnectionFactory.createConnection().start();
return cachingConnectionFactory;
}
When I use the cachingConnectionFactory.createConnection().start();
line
I can see that when my app starts it shows:
3370 [main] INFO o.s.j.c.CachingConnectionFactory - Established shared JMS Connection: ActiveMQConnection {id=ID:sometext,clientId=ManolitoActiveMQ,started=false}
Has sense expect that message when the app starts and read Established shared JMS Connection
but why shows started=false
? I think should be true.
If I comment cachingConnectionFactory.createConnection().start();
and start the app, the message shown above does not appear, ok, it is expected. But later through JMX
when I start to send messages, I can see again
3370 [main] INFO o.s.j.c.CachingConnectionFactory - Established shared JMS Connection: ActiveMQConnection {id=ID:sometext,clientId=ManolitoActiveMQ,started=false}
Ok it is expected, but again started=false
appears
It is confuse in some point because the cachingConnectionFactory.createConnection().start()
line ends with start()
for the Connection
- Therefore why practically always appears
started=false
? - When or how that
started
attribute would appear withtrue
?