Announcement Announcement Module
No announcement yet.
How do I Autostart DefaultMessageListenerContainer? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I Autostart DefaultMessageListenerContainer?

    I am attempting to autostart my DMLC. In another app we do it fine, but this one must be different. My configuration is below. I am attempting to set "autoStartup" but that does not seem to work.

    Am I wrong in assuming this is the way to autostart after a jvm reboot? I can use a servlet or Task. How do you guys do it?

    <!-- This hooks us up to the jndi -->
    	<jee:jndi-lookup id="telematicsJNDIConnectionFactory" jndi-name="${mq.jndi}" cache="true" lookup-on-startup="true" />
    	<!-- The outer wrapper must be TransactionAware, the inner custom one will cache the connection -->
    	<bean id="telematicsConnectionFactory" class="org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy">
    		<property name="targetConnectionFactory">
    			<bean class="dds.tmatic.utils.CustomConnectionFactory">
    				<property name="targetConnectionFactory">
    					<ref bean="telematicsJNDIConnectionFactory" />
    				<property name="username">
    				<property name="password">
    				<property name="sessionCacheSize">
    		<property name="synchedLocalTransactionAllowed" value="true" />
    	<!-- this is the class that will be kicked off when a message hits the q -->
    	<bean id="telematicsMessageListener" class="dds.tmatic.service.TMaticListener" />
    	<!-- This is the listener that kicks off messages when they hit the q -->
    	<bean id="telematicsListenerContainer" class="dds.tmatic.service.TMaticListenerContainerImpl">
    		<constructor-arg index="0">
    			<bean class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    				<property name="connectionFactory" ref="telematicsConnectionFactory" />
    				<property name="destinationName" value="${}" />
    				<property name="messageListener" ref="telematicsMessageListener" />
    				<property name="maxConcurrentConsumers" value="${mq.maxcc}" />
    				<property name="concurrentConsumers" value="${}" />
    				<property name="sessionTransacted" value="true" />
    				<property name="autoStartup" value="${mq.strt}" />
    				<property name="cacheLevelName" value="CACHE_CONNECTION" />
    We are using Spring 3.0.6.
    Last edited by markthegrea; Apr 4th, 2013, 09:29 AM. Reason: add info

  • #2
    Fixed this by taking out the DMLC and creating it outside the wrapper...


    • #3
      Sorry - didn't see this earlier - yes inner beans are not registered, and don't participate in the context lifecycle.