Hi,
Our application requires JMS topic subscribers. We use the DefaultMessageListenerContainer and MessageListenerAdapter classes, as well as POJOs with a listener method specified declaratively.
When the beans are declared as singletons, it works great.
When the beans are declared as prototypes, it does not work. The following exception is thrown:
You will find below my beans declarations (class names are abbreviated). The prototypes are instantiated by retrieving them from the beans factory with getBean(). The containerProto is customized with setMessageSelector() and setMessageListener() , and the messageListenerAdapterProto is customized with setDelegate().Code:java.lang.IllegalStateException: No message listener specified - see property 'messageListener'
By the way, we use Spring 2.5.1 and ActiveMQ 5.0.0.
Thanks for your help,
Francois
Code:<bean id="containerProto" class=" DefaultMessageListenerContainer" scope="prototype"> <property name="connectionFactory" ref="singleConnectionFactory" /> <property name="destination" ref="topic" /> <!-- messageSelector and messageListener to be set programmatically --> </bean> <bean id="messageListenerAdapterProto" class="MessageListenerAdapter" scope="prototype"> <property name="defaultListenerMethod" value="notify"/> <property name="defaultResponseDestination" ref="topic"/> <!-- delegate to be set programmatically --> </bean>


Reply With Quote