I\'ve setup a spring config for JMS. Things work fine, except I can\'t seem to get it to lazy load (notice the default-lazy-init true in the code below). If I comment out the jm
OK, this is pretty obscure, but DefaultMessageListenerContainer
implements the Lifecycle
interface, and beans that implement this are tied into the context's own lifecycle - when the context starts up, Lifecycle
-implementing beans are initialised and started. This means that your lazy-init config is essentially ignored.
The solution is to use autoStartup to false. See the code below.
<bean id="listenerContainer"
class="org.springframework.jms.listener.DefaultMessageListenerContainer">
........
<property name="autoStartup" value="false"/>
</bean>
~Shyam