Dear all,
thank you very much for your answers.
I had temporarily solved the question using an eip configuration. Now that I 
tried again to use a topic the problem arise again.
Would you kindly help me because I can't understand where the problem is?

I'll send the code so you can see and tell me where I did wrong... and I remind 
in few words what I'm trying to do:

-there are four POJO:
SimpleComponent1, SimpleComponent2, SimpleComponent3,
SimpleComponent4,( they are identical except for name and
some prints)
-each POJO first receive a message from an external queue each
 (simple.input1, simple.input2, simple.input3, simple.input4)
-after they have received that message, they send it to the other 3 POJOs and 
to itself.

I undestood that there is a thread for every message received
and that I have to use thread-safe code but
even if I put in a synchronized block all the content
of the method OnMessageExchange, some messages get lost.

I wonder that I' ve made some configuration error,
so I'll send configuration file too.

The configuration have a jms provider to which the POJOs send
messages, this jms porvider write to a topic
and there are four jms consumer that listens to this topic
and deliver message to its correspondig POJOs

I'd very grateful if someone can spent few minutes and explain how to make the 
things works or at least where
is the error and what I did not understand well.
Thank you in advance,
sorry if I haven't look at the right documents.
Best regards

silvia





---------- Initial Header -----------

>From      : "Gert Vanthienen" [email protected]
To          : [email protected]
Cc          :
Date      : Tue, 16 Dec 2008 09:21:44 +0100
Subject : Re: onMessageExchange problems







> Silvia,
>
> The servicemix-bean component uses a thread pool to handle multiple
> messages concurrently.  There's not really anything special you need to
> do, but you should however take care to write your onMessageExchange
> method in a thread-safe way.  Btw, I guess you're using a JMS and Bean 
> SU, right?
>
> If you have any more problems with this, could you post the code from
> you servicemix-bean component.  Another possibility to troubleshoot this
> is by enabling DEBUG logging and looking at the MessageExchanges (more 
> particularly at the MEP and the status code) to figure out where
> messages get lost.
>
> Regards,
>
> Gert
>
> silvia_magrelli wrote:
> > Hi,
> > I have implemented my publish\subscribe with bcs and bean ses
> > and 1 topic. I have to realize many to many comunication.
> > If I realize one to many comunication (1 publisher and 3 subscribers(one of 
> > the subscriber is the publisher itself)) all works well.
> > Instead if I use many to many with all the three component that
> > i have are publisher and subscriber at the same time then some
> > message get lost.
> > I wonder that the reason is that the call to onMessageExchange in my bean 
> > that found it busy doesn't
> > retry for a second time, there isn't buffering of
> > such method's invocations or there isn't a new thread that
> > treat the message receiving.
> > Did I understand well?
> > What methods and classes should I have to use in servicemix
> > to not loose messages and treat them all in my java-bean components ?
> > (I'm using servicemix 3.2.1)
> > Please help me!
> > Thank You in advance for your help!
> > greetings,
> > silvia
> >
> >
> >
>
>


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:bean="http://servicemix.apache.org/bean/1.0";
	 xmlns:mp="http://myproject.com/components";>

  	<bean:endpoint service="mp:simpleComponent1"
  		endpoint="simpleEndpoint1"
  		bean="#simpleBean1"/>

  	<bean:endpoint service="mp:simpleComponent1"
  		endpoint="eC1"
  		bean="#simpleBean1"/>

  	<bean id="simpleBean1" class="component.SimpleComponent1" />

  	<bean:endpoint service="mp:simpleComponent2"
  		endpoint="simpleEndpoint2"
  		bean="#simpleBean2"/>

  	<bean:endpoint service="mp:simpleComponent2"
  		endpoint="eC2"
  		bean="#simpleBean2"/>

  	<bean id="simpleBean2" class="component.SimpleComponent2" />

  	<bean:endpoint service="mp:simpleComponent3"
  		endpoint="simpleEndpoint3"
  		bean="#simpleBean3"/>

  	<bean:endpoint service="mp:simpleComponent3"
  		endpoint="eC3"
  		bean="#simpleBean3"/>

  	<bean id="simpleBean3" class="component.SimpleComponent3" />

	<bean:endpoint service="mp:simpleComponent4"
  		endpoint="simpleEndpoint4"
  		bean="#simpleBean4"/>

  	<bean:endpoint service="mp:simpleComponent4"
  		endpoint="eC4"
  		bean="#simpleBean4"/>

  	<bean id="simpleBean4" class="component.SimpleComponent4" />
</beans>



<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0";
       xmlns:mp="http://myproject.com/components";>

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

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

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

  <jms:consumer service="mp:simpleConsumer4"
       endpoint="simpleEndpoint4"
  	   targetService="mp:simpleComponent4"
	   targetEndpoint="simpleEndpoint4"
       destinationName="simple.input4"
       connectionFactory="#connectionFactory"/>

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

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

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

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

  <jms:consumer service="mp:ServizioConsumer4"
       endpoint="eC4"
       targetService="mp:simpleComponent4"                             
       targetEndpoint="eC4"
	 pubSubDomain="true"
       destinationName="topic1"
       connectionFactory="#connectionFactory" />

  <bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="tcp://localhost:61616" />
  </bean>

</beans>



Reply via email to