Announcement Announcement Module
Collapse
No announcement yet.
Durable subscription does not work Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Durable subscription does not work

    I've a sample that works when I does not specify a durable subscription.
    When I set the different properties so that my consumers are durable consumer, I do not receive any message ?

    Here is the applicationContext.xml that does not work :

    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns:beans="http://www.springframework.org/schema/beans"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">	
    
    	<!--  Partie JMS -->
    	<bean id="jmsFactory"
    		class="org.apache.activemq.ActiveMQConnectionFactory">
    		<property name="brokerURL">
    			<value>tcp://localhost:61616</value>
    		</property>
    	</bean>
    
    	<bean id="jmsTemplate"
    		class="org.springframework.jms.core.JmsTemplate" abstract="true">
    		<property name="connectionFactory">
    			<bean
    				class="org.springframework.jms.connection.SingleConnectionFactory">
    				<property name="targetConnectionFactory">
    					<ref local="jmsFactory" />
    				</property>
    			</bean>
    		</property>
    	</bean>
    	<bean id="producer.cre"
    		class="org.apache.activemq.command.ActiveMQTopic">
    		<constructor-arg index="0">
    			<value>producer.cre</value>
    		</constructor-arg>
    	</bean>
    	<bean id="jmsCreTemplate" parent="jmsTemplate">
    		<property name="pubSubDomain" value="true" />
    		<property name="defaultDestination" ref="producer.cre" />
    		<property name="deliveryPersistent" value="true" />
    		<property name="explicitQosEnabled" value="true" />
    	</bean>
    
    	<bean id="creEventRecorder"
    		class="com.bnpp.k2.cre.history.CreEventRecorder" />
    
    	<bean id="creEventRecorderListener"
    		class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    		<property name="concurrentConsumers" value="1" />
    		<property name="connectionFactory" ref="jmsFactory" />
    		<property name="destination" ref="producer.cre" />
    		<property name="messageListener" ref="creEventRecorder" />
    		<property name="subscriptionDurable" value="true" />
    		<property name="durableSubscriptionName" value="creEventRecorderListener" />
    	</bean>
    	<bean id="creEventAccounting"
    		class="com.bnpp.k2.cre.accounting.CreEventAccounting" />
    	<bean id="creEventAccountingListener"
    		class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    		<property name="concurrentConsumers" value="1" />
    		<property name="connectionFactory" ref="jmsFactory" />
    		<property name="destination" ref="producer.cre" />
    		<property name="messageListener" ref="creEventAccounting" />
    
    <!-- If I do not set the 2 following properties, everything works -->
    		<property name="subscriptionDurable" value="true" />
    		<property name="durableSubscriptionName" value="creEventAccountingListener" />
    	</bean>
    
    </beans>
    I use ActiveMQ 4.1.0 and Spring 2.0

    Thanks for any response

  • #2
    It works if I define the clientId property of my DefaultMessageListenerContainer

    Comment


    • #3
      It works if I define the clientId property of my DefaultMessageListenerContainer

      Hi,

      what have u set client id as??

      Comment


      • #4
        sorry it's a too long story I

        Comment

        Working...
        X