You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by silvia_magrelli <si...@libero.it> on 2008/12/31 16:39:27 UTC

publish subscribe- jms config- durable consumer- please help me!!

Hi,
I have understood that the subscriprion to a topic of a jms consumer must be durable, and that is probably the reason of my previous problem of loss of messages.

I have to realize a publish subscribe and I used some jms consumers and one provider in my configuration. The comunication must be many-to-many.
So all my POJOs send 1 message and every POJO must receive a copy of the message sent by the others and by itself.
( the configuration file is copied at the end ) 
The problem was that messages get lost.

I have seen with the debug modality of log4j of the activemq 
that every single jms consumer appear and desappear so if some one send a message even on a single consumer, in the moment it disappear, the consumer never receive that.
( I tried using jconsole and saw how the topic doesn't deliver the message to the consumer )

So I think the problem is the durability of 
the subscription of the consumer to the topic.

I did understand well the problem?

If the answer is yes, can somebody please tell me how to set the appropriate configuration?

here is my configuration:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
       xmlns:esb="http://esbinaction.com/examples">

  <jms:consumer service="esb:simpleConsumer1"
       endpoint="simpleEndpoint1"
  	   targetService="esb:simpleComponent1"
	   targetEndpoint="simpleEndpoint1"
       destinationName="simple.input1"
       connectionFactory="#connectionFactory"/>

  <jms:consumer service="esb:simpleConsumer2"
       endpoint="simpleEndpoint2"
  	   targetService="esb:simpleComponent2"
	   targetEndpoint="simpleEndpoint2"
       destinationName="simple.input2"
       connectionFactory="#connectionFactory"/>

  <jms:consumer service="esb:simpleConsumer3"
       endpoint="simpleEndpoint3"
  	   targetService="esb:simpleComponent3"
	   targetEndpoint="simpleEndpoint3"
       destinationName="simple.input3"
       connectionFactory="#connectionFactory"/>

  <jms:provider service="esb:ServizioProvider"
       endpoint="endpointProvider"
	 pubSubDomain="true"
       destinationName="topic1"
       connectionFactory="#connectionFactory" />

 <jms:consumer service="esb:ServizioConsumer1"
       endpoint="eC1"
       targetService="esb:simpleComponent1"                                 
       targetEndpoint="eC1"
	 pubSubDomain="true"
       destinationName="topic1"
       connectionFactory="#connectionFactory" />

  <jms:consumer service="esb:ServizioConsumer2"
       endpoint="eC2"
       targetService="esb:simpleComponent2"                                 
       targetEndpoint="eC2"
	 pubSubDomain="true"
       destinationName="topic1"
       connectionFactory="#connectionFactory" />

  <jms:consumer service="esb:ServizioConsumer3"
       endpoint="eC3"
       targetService="esb:simpleComponent3"                                 
       targetEndpoint="eC3"
	 pubSubDomain="true"
       destinationName="topic1"
       connectionFactory="#connectionFactory" />

  <jms:consumer service="esb:springConsumer"
  	   endpoint="simpleSpringEndpoint" 
       targetService="esb:simpleSpringComponent"
       destinationName="simpleSpring.input"
       connectionFactory="#connectionFactory"/>
  
  <bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="tcp://localhost:61616" />
  </bean>

</beans>

Thank you in advance for your answers.
Greetings, 
Silvia