You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by "Michael-P." <Mi...@ses-astra.com> on 2010/01/13 09:46:45 UTC

Re: Servicemix-bean send messages

Hi,

does anybody know a solution?

Camel route "from(servicemix-bean).to(another servicemix-bean)"

Please find details in the old posts!

Thanks in advance! Best regards

Michael




Michael-P. wrote:
> 
> Hi,
> 
> My problem is, that I want to send a message from the Camel timer to my
> ListenerBean. Routed by Camel. From my ListenerBean I want to send another
> message to my second bean (MyBean). I would like to configure this route
> also in Camel. When I use the following configuration in Camel I get an
> exception. I can send you the log file if it helps.
> 
> How can I configure the "to(...)" and "from(...)" routes in Camel?
> 
> 
> public class MyRouteBuilder extends RouteBuilder {
>> 
>> 	public void configure() {
>> 		
>> 		from("timer://tutorial?fixedRate=true&delay=3000&period=10000")
>> 	        .setBody(constant("<message>SRQ</message>"))
>> 	       
>> .to("jbi:endpoint:urn:org:apache:servicemix:example:bean:jms:provider");
>>         
>> 	       
>> from("jbi:endpoint:urn:org:apache:servicemix:example:bean:jms:consumer")
>> 	       
>> .to("jbi:endpoint:org:apache:servicemix:example:bean:bean:bean1");
>>         
>> 	       
>> from("jbi:endpoint:org:apache:servicemix:example:bean:bean:bean1")
>> 	       
>> .to("jbi:endpoint:org:apache:servicemix:example:bean2:bean:bean2");
>> 	}
>> }
> 
> Many thanks in advance, best regards
> 
> Michael Preuß
> 
> 
> Gert Vanthienen wrote:
>> 
>> Michael,
>> 
>> Everytime you start route with from("jbi:..."), you get a new endpoint
>> you can use to send exchanges to.  Your ListenerBean already has the
>> necessary code to send to an endpoint with service name
>> {org:apache:servicemix:example:bean2}bean.  To create this endpoint
>> from a Camel route, you would have to create a route that starts with
>> from('jbi:service:org:apache:servicemix:example:bean2:bean")...
>> 
>> If you want to create a route that sits between the existing
>> ListenerBean and the bean2 endpoint, you have to add another endpoint
>> in the middle.  E.g. you camel route could look like:
>> from('jbi:endpoint:urn:test:service:endpoint").to("jbi:service:org:apache:servicemix:example:bean2:bean");
>> 
>> The code in your ListenerBean would then look like this:
>> InOnly sendExchange = ...
>> sendExchange.setService(new QName("urn:test", "service");
>> 
>> Regards,
>> 
>> Gert Vanthienen
>> ------------------------
>> Open Source SOA: http://fusesource.com
>> Blog: http://gertvanthienen.blogspot.com/
>> 
>> 
>> 
>> 2009/12/3 Michael-P. <Mi...@ses-astra.com>:
>>>
>>> Hi again,
>>>
>>> I solved the problem, but not in my preferred way.
>>> At the moment I use the Camel RouteBuilder (Code:
>>> http://old.nabble.com/file/p26628850/MyRouteBuilder.java
>>> MyRouteBuilder.java
>>> ) to send a message from the Camel timer to a JMS Queue and from there
>>> to
>>> one of my servicemix-bean components.
>>> In the onMessageExchange method I create another Exchange and send it to
>>> a
>>> second servicemix-bean component (Code:
>>> http://old.nabble.com/file/p26628850/ListenerBean.java ListenerBean.java
>>> ).
>>> The second bean just prints out the message (Code:
>>> http://old.nabble.com/file/p26628850/MyBean.java MyBean.java ).
>>>
>>> This works but it would be nice if I would configure the route for the
>>> message in the Camel RouteBuilder. Unfortunately I didn't find an
>>> example
>>> which shows me the way to do it.
>>>
>>> I would like to have:
>>>
>>> public void configure(){
>>>
>>>   ...
>>>
>>>   from(bean1)             <-- What should be typed in here (The URI of
>>> bean1 is wrong)
>>>   .to(URI of bean2);
>>>
>>> }
>>>
>>> Does anybody know how to do it?
>>>
>>> Thanks in advance, best regards
>>>
>>>    Michael Preuß
>>>
>>>
>>> Michael-P. wrote:
>>>>
>>>> Hi,
>>>>
>>>> you're right about the endpoints being the same and I want to start a
>>>> new
>>>> MessageExchange from within my bean.
>>>> I want to send a message from the servicemix-bean to another component
>>>> (In
>>>> my example to the camel logging service). I guess the problem is to
>>>> configure the route in the Camel RouteBuilder from my bean to the camel
>>>> logging service. Forget all my code and explanations, what do I have to
>>>> use (URI) in the from definition in the Camel RouteBuilder when I want
>>>> to
>>>> route a message exchange from my servicemix-bean to wherever?
>>>>
>>>> Additionally have you an example which showes the servicemix-bean code
>>>> to
>>>> send a message out? I found this page:
>>>> http://servicemix.apache.org/client-api.html, but the client API link
>>>> leads to a completely different page and I don't know how I have to
>>>> create
>>>> the "client" object (where can I get the "context" object?).
>>>>
>>>>
>>>> Gert Vanthienen wrote:
>>>>>
>>>>> Michael,
>>>>>
>>>>> First of all, sorry it took me so long to get back to you.
>>>>>
>>>>> After taking another look at this, I think I'm beginning to see where
>>>>> the problem is.  I'm guessing you have a servicemix-bean endpoint
>>>>> that's called {org.apache.servicemix.bean}bean and you want to log
>>>>> everything that's going to that endpoint, right?
>>>>>
>>>>> Now, whever you start to a Camel route with from("jbi:..."), the
>>>>> endpoint referred to in the from will itself become an endpoint on the
>>>>> NMR.  So, by doing this, you get a duplicate name (one for the
>>>>> servicemix-bean endpoint and another for the from(jbi:).
>>>>>
>>>>> If you just want to log the message that is going to/from the bean
>>>>> endpoint, you can alter the route just before that
>>>>> from("jbi:endpoint:urn:org:apache:servicemix:example:bean:jms:consumer")
>>>>> .to("log:before-bean)
>>>>> .to("jbi:endpoint:org:apache:servicemix:example:bean:bean:endpoint")
>>>>> .to("log:after-bean);
>>>>>
>>>>> If, on the other hand, you want to start a new MessageExchange from
>>>>> within the bean and send that to the Camel route with the log:
>>>>> endpoint, you have to make sure the name of that endpoint is different
>>>>> than the name of your bean endpoint itself.  Upon sending the exchange
>>>>> to the log route, you can set the target service to be that you
>>>>> specified in the from("jbi:...") for the log route.
>>>>>
>>>>> Regards,
>>>>>
>>>>> Gert Vanthienen
>>>>> ------------------------
>>>>> Open Source SOA: http://fusesource.com
>>>>> Blog: http://gertvanthienen.blogspot.com/
>>>>>
>>>>>
>>>>>
>>>>> 2009/11/26 Michael-P. <Mi...@ses-astra.com>:
>>>>>>
>>>>>> Hello
>>>>>>
>>>>>> Many thanks for your tips. For me all attached files are available
>>>>>> when
>>>>>> I
>>>>>> click on the links. :confused:
>>>>>>
>>>>>> I deleted all entries in the data directory and added the if ACTIVE
>>>>>> check,
>>>>>> but that solved not the problem.
>>>>>>
>>>>>> I found that the error occurs when try to configure a route in the
>>>>>> Camel
>>>>>> RouteBuilder from the servicemix-bean to the log:XXX service.
>>>>>>
>>>>>> public void configure() {
>>>>>>
>>>>>>        
>>>>>>  from("timer://tutorial?fixedRate=true&delay=3000&period=10000")
>>>>>>         .setBody(constant("<message>SRQ</message>"))
>>>>>>
>>>>>> .to("jbi:endpoint:urn:org:apache:servicemix:example:bean:jms:provider");
>>>>>>
>>>>>>
>>>>>> from("jbi:endpoint:urn:org:apache:servicemix:example:bean:jms:consumer")
>>>>>>
>>>>>> .to("jbi:endpoint:org:apache:servicemix:example:bean:bean:endpoint");
>>>>>>
>>>>>>
>>>>>> from("jbi:endpoint:org:apache:servicemix:example:bean:bean:endpoint")
>>>>>>         .to("log:beanExample");
>>>>>> }
>>>>>>
>>>>>> Did I here a mistake? I'm wondering to use an endpoint in the from
>>>>>> definition but I find no example to configure something more in the
>>>>>> servicemix-bean xbean.xml file.
>>>>>>
>>>>>> Again, many thanks in advance!
>>>>>>
>>>>>>
>>>>>> Best regards
>>>>>>
>>>>>> Michael Preuß
>>>>>>
>>>>>>
>>>>>> Gert Vanthienen wrote:
>>>>>>>
>>>>>>> L.S.,
>>>>>>>
>>>>>>> The exception you posted in the mailing list indicates that two
>>>>>>> endpoints are being configured with the same name.  I haven't found
>>>>>>> the duplicate name in you own configuration at first glance (some of
>>>>>>> the links you posted seem to be no longer available), so it might
>>>>>>> just
>>>>>>> be a consequence of a failed deployment.  Could you try stopping
>>>>>>> servicemix, deleting the entire data directory and then restart the
>>>>>>> ESB to see if you get a clean deploy then?
>>>>>>>
>>>>>>> Now, at runtime, there's a problem with your ListenerBean.  The
>>>>>>> onMessageExchange method will be used to handle the first incoming
>>>>>>> exchange, but it will also get invoked whenever the DONE
>>>>>>> MessageExchange you're sending comes back.  Your code will set the
>>>>>>> DONE status on that exchange again, which will cause exceptions.
>>>>>>>  You
>>>>>>> probably want to add a check for if (exchange.getStatus() ==
>>>>>>> ExchangeStatus.ACTIVE) before handling the exchange.
>>>>>>>
>>>>>>> Another option could be to add the bean to the Camel SU.  Since
>>>>>>> you're
>>>>>>> already using Camel in your route, it might be easier to use Camel's
>>>>>>> excellent http://camel.apache.org/bean-integration.html instead of
>>>>>>> dealing with the JBI MessageExchanges directory from a
>>>>>>> servicemix-bean.
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> Gert Vanthienen
>>>>>>> ------------------------
>>>>>>> Open Source SOA: http://fusesource.com
>>>>>>> Blog: http://gertvanthienen.blogspot.com/
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://old.nabble.com/Servicemix-bean-send-messages-tp26525328p26531243.html
>>>>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> -----
>>>>> ---
>>>>> Gert Vanthienen
>>>>> http://gertvanthienen.blogspot.com
>>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Servicemix-bean-send-messages-tp26525328p26628850.html
>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
>> -----
>> ---
>> Gert Vanthienen
>> http://gertvanthienen.blogspot.com
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Servicemix-bean-send-messages-tp26525328p27141417.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Servicemix-bean send messages

Posted by tranchida <gi...@tranchida.ch>.

The Camel route can  be 

  <camelContext id="pipeline-demo"
xmlns="http://activemq.apache.org/camel/schema/spring">
  
  	<route id="pipeline-route">
  		<from uri="timer://pipeline?fixedRate=true&amp;period=30000"/>
  		<inOut uri="jbi:endpoint:http://www.tranchida.ch/demo/bean1/bean"/>
  		<inOut uri="jbi:endpoint:http://www.tranchida.ch/demo/bean2/bean"/>
  	</route>
  </camelContext>

This is ESB concept, service orchestration 
in this example, out from bean1 is used as in for bean2
Bean1 don't have to know anything about bean2


Michael-P. wrote:
> 
> Hi,
> 
> Thanks for the reply. At the moment I don't really want to get into things
> like the pipeline pattern and processors, I just wanted to know how to
> communicate between to simple beans.
> 
> I've implemented these beans myself and I just wanted to be able to plug
> them in and send messages between them. Making use of the ServiceMix
> concept.
> 
> Do you have any examples regarding the routing via Camel? My problem is
> the "from"configuration.
> 
> Thanks in advance, best regards
> 
> Michael
> 
> 
> 
> tranchida wrote:
>> 
>> Hello,
>> 
>> You have to use the pipeline pattern
>> http://camel.apache.org/pipes-and-filters.html
>> But you have to be sure that you servicemix bean support in-out exchange 
>> 
>> Why to use servicemix-bean ?
>> 
>> You can do everything with Camel using processor
>> http://camel.apache.org/processor.html is more simple.
>> 
>> Regards
>> 
>> 
>> 
>> 
>> 
>> Michael-P. wrote:
>>> 
>>> Hi,
>>> 
>>> does anybody know a solution?
>>> 
>>> Camel route "from(servicemix-bean).to(another servicemix-bean)"
>>> 
>>> Please find details in the old posts!
>>> 
>>> Thanks in advance! Best regards
>>> 
>>> Michael
>>> 
>>> 
>>> 
>>> 
>>> Michael-P. wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> My problem is, that I want to send a message from the Camel timer to my
>>>> ListenerBean. Routed by Camel. From my ListenerBean I want to send
>>>> another message to my second bean (MyBean). I would like to configure
>>>> this route also in Camel. When I use the following configuration in
>>>> Camel I get an exception. I can send you the log file if it helps.
>>>> 
>>>> How can I configure the "to(...)" and "from(...)" routes in Camel?
>>>> 
>>>> 
>>>> public class MyRouteBuilder extends RouteBuilder {
>>>>> 
>>>>> 	public void configure() {
>>>>> 		
>>>>> 		from("timer://tutorial?fixedRate=true&delay=3000&period=10000")
>>>>> 	        .setBody(constant("<message>SRQ</message>"))
>>>>> 	       
>>>>> .to("jbi:endpoint:urn:org:apache:servicemix:example:bean:jms:provider");
>>>>>         
>>>>> 	       
>>>>> from("jbi:endpoint:urn:org:apache:servicemix:example:bean:jms:consumer")
>>>>> 	       
>>>>> .to("jbi:endpoint:org:apache:servicemix:example:bean:bean:bean1");
>>>>>         
>>>>> 	       
>>>>> from("jbi:endpoint:org:apache:servicemix:example:bean:bean:bean1")
>>>>> 	       
>>>>> .to("jbi:endpoint:org:apache:servicemix:example:bean2:bean:bean2");
>>>>> 	}
>>>>> }
>>>> 
>>>> Many thanks in advance, best regards
>>>> 
>>>> Michael Preuß
>>>> 
>>>> 
>>>> Gert Vanthienen wrote:
>>>>> 
>>>>> Michael,
>>>>> 
>>>>> Everytime you start route with from("jbi:..."), you get a new endpoint
>>>>> you can use to send exchanges to.  Your ListenerBean already has the
>>>>> necessary code to send to an endpoint with service name
>>>>> {org:apache:servicemix:example:bean2}bean.  To create this endpoint
>>>>> from a Camel route, you would have to create a route that starts with
>>>>> from('jbi:service:org:apache:servicemix:example:bean2:bean")...
>>>>> 
>>>>> If you want to create a route that sits between the existing
>>>>> ListenerBean and the bean2 endpoint, you have to add another endpoint
>>>>> in the middle.  E.g. you camel route could look like:
>>>>> from('jbi:endpoint:urn:test:service:endpoint").to("jbi:service:org:apache:servicemix:example:bean2:bean");
>>>>> 
>>>>> The code in your ListenerBean would then look like this:
>>>>> InOnly sendExchange = ...
>>>>> sendExchange.setService(new QName("urn:test", "service");
>>>>> 
>>>>> Regards,
>>>>> 
>>>>> Gert Vanthienen
>>>>> ------------------------
>>>>> Open Source SOA: http://fusesource.com
>>>>> Blog: http://gertvanthienen.blogspot.com/
>>>>> 
>>>>> 
>>>>> 
>>>>> 2009/12/3 Michael-P. <Mi...@ses-astra.com>:
>>>>>>
>>>>>> Hi again,
>>>>>>
>>>>>> I solved the problem, but not in my preferred way.
>>>>>> At the moment I use the Camel RouteBuilder (Code:
>>>>>> http://old.nabble.com/file/p26628850/MyRouteBuilder.java
>>>>>> MyRouteBuilder.java
>>>>>> ) to send a message from the Camel timer to a JMS Queue and from
>>>>>> there to
>>>>>> one of my servicemix-bean components.
>>>>>> In the onMessageExchange method I create another Exchange and send it
>>>>>> to a
>>>>>> second servicemix-bean component (Code:
>>>>>> http://old.nabble.com/file/p26628850/ListenerBean.java
>>>>>> ListenerBean.java ).
>>>>>> The second bean just prints out the message (Code:
>>>>>> http://old.nabble.com/file/p26628850/MyBean.java MyBean.java ).
>>>>>>
>>>>>> This works but it would be nice if I would configure the route for
>>>>>> the
>>>>>> message in the Camel RouteBuilder. Unfortunately I didn't find an
>>>>>> example
>>>>>> which shows me the way to do it.
>>>>>>
>>>>>> I would like to have:
>>>>>>
>>>>>> public void configure(){
>>>>>>
>>>>>>   ...
>>>>>>
>>>>>>   from(bean1)             <-- What should be typed in here (The URI
>>>>>> of
>>>>>> bean1 is wrong)
>>>>>>   .to(URI of bean2);
>>>>>>
>>>>>> }
>>>>>>
>>>>>> Does anybody know how to do it?
>>>>>>
>>>>>> Thanks in advance, best regards
>>>>>>
>>>>>>    Michael Preuß
>>>>>>
>>>>>>
>>>>>> Michael-P. wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> you're right about the endpoints being the same and I want to start
>>>>>>> a new
>>>>>>> MessageExchange from within my bean.
>>>>>>> I want to send a message from the servicemix-bean to another
>>>>>>> component (In
>>>>>>> my example to the camel logging service). I guess the problem is to
>>>>>>> configure the route in the Camel RouteBuilder from my bean to the
>>>>>>> camel
>>>>>>> logging service. Forget all my code and explanations, what do I have
>>>>>>> to
>>>>>>> use (URI) in the from definition in the Camel RouteBuilder when I
>>>>>>> want to
>>>>>>> route a message exchange from my servicemix-bean to wherever?
>>>>>>>
>>>>>>> Additionally have you an example which showes the servicemix-bean
>>>>>>> code to
>>>>>>> send a message out? I found this page:
>>>>>>> http://servicemix.apache.org/client-api.html, but the client API
>>>>>>> link
>>>>>>> leads to a completely different page and I don't know how I have to
>>>>>>> create
>>>>>>> the "client" object (where can I get the "context" object?).
>>>>>>>
>>>>>>>
>>>>>>> Gert Vanthienen wrote:
>>>>>>>>
>>>>>>>> Michael,
>>>>>>>>
>>>>>>>> First of all, sorry it took me so long to get back to you.
>>>>>>>>
>>>>>>>> After taking another look at this, I think I'm beginning to see
>>>>>>>> where
>>>>>>>> the problem is.  I'm guessing you have a servicemix-bean endpoint
>>>>>>>> that's called {org.apache.servicemix.bean}bean and you want to log
>>>>>>>> everything that's going to that endpoint, right?
>>>>>>>>
>>>>>>>> Now, whever you start to a Camel route with from("jbi:..."), the
>>>>>>>> endpoint referred to in the from will itself become an endpoint on
>>>>>>>> the
>>>>>>>> NMR.  So, by doing this, you get a duplicate name (one for the
>>>>>>>> servicemix-bean endpoint and another for the from(jbi:).
>>>>>>>>
>>>>>>>> If you just want to log the message that is going to/from the bean
>>>>>>>> endpoint, you can alter the route just before that
>>>>>>>> from("jbi:endpoint:urn:org:apache:servicemix:example:bean:jms:consumer")
>>>>>>>> .to("log:before-bean)
>>>>>>>> .to("jbi:endpoint:org:apache:servicemix:example:bean:bean:endpoint")
>>>>>>>> .to("log:after-bean);
>>>>>>>>
>>>>>>>> If, on the other hand, you want to start a new MessageExchange from
>>>>>>>> within the bean and send that to the Camel route with the log:
>>>>>>>> endpoint, you have to make sure the name of that endpoint is
>>>>>>>> different
>>>>>>>> than the name of your bean endpoint itself.  Upon sending the
>>>>>>>> exchange
>>>>>>>> to the log route, you can set the target service to be that you
>>>>>>>> specified in the from("jbi:...") for the log route.
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>>
>>>>>>>> Gert Vanthienen
>>>>>>>> ------------------------
>>>>>>>> Open Source SOA: http://fusesource.com
>>>>>>>> Blog: http://gertvanthienen.blogspot.com/
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> 2009/11/26 Michael-P. <Mi...@ses-astra.com>:
>>>>>>>>>
>>>>>>>>> Hello
>>>>>>>>>
>>>>>>>>> Many thanks for your tips. For me all attached files are available
>>>>>>>>> when
>>>>>>>>> I
>>>>>>>>> click on the links. :confused:
>>>>>>>>>
>>>>>>>>> I deleted all entries in the data directory and added the if
>>>>>>>>> ACTIVE
>>>>>>>>> check,
>>>>>>>>> but that solved not the problem.
>>>>>>>>>
>>>>>>>>> I found that the error occurs when try to configure a route in the
>>>>>>>>> Camel
>>>>>>>>> RouteBuilder from the servicemix-bean to the log:XXX service.
>>>>>>>>>
>>>>>>>>> public void configure() {
>>>>>>>>>
>>>>>>>>>        
>>>>>>>>>  from("timer://tutorial?fixedRate=true&delay=3000&period=10000")
>>>>>>>>>         .setBody(constant("<message>SRQ</message>"))
>>>>>>>>>
>>>>>>>>> .to("jbi:endpoint:urn:org:apache:servicemix:example:bean:jms:provider");
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> from("jbi:endpoint:urn:org:apache:servicemix:example:bean:jms:consumer")
>>>>>>>>>
>>>>>>>>> .to("jbi:endpoint:org:apache:servicemix:example:bean:bean:endpoint");
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> from("jbi:endpoint:org:apache:servicemix:example:bean:bean:endpoint")
>>>>>>>>>         .to("log:beanExample");
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> Did I here a mistake? I'm wondering to use an endpoint in the from
>>>>>>>>> definition but I find no example to configure something more in
>>>>>>>>> the
>>>>>>>>> servicemix-bean xbean.xml file.
>>>>>>>>>
>>>>>>>>> Again, many thanks in advance!
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Best regards
>>>>>>>>>
>>>>>>>>> Michael Preuß
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Gert Vanthienen wrote:
>>>>>>>>>>
>>>>>>>>>> L.S.,
>>>>>>>>>>
>>>>>>>>>> The exception you posted in the mailing list indicates that two
>>>>>>>>>> endpoints are being configured with the same name.  I haven't
>>>>>>>>>> found
>>>>>>>>>> the duplicate name in you own configuration at first glance (some
>>>>>>>>>> of
>>>>>>>>>> the links you posted seem to be no longer available), so it might
>>>>>>>>>> just
>>>>>>>>>> be a consequence of a failed deployment.  Could you try stopping
>>>>>>>>>> servicemix, deleting the entire data directory and then restart
>>>>>>>>>> the
>>>>>>>>>> ESB to see if you get a clean deploy then?
>>>>>>>>>>
>>>>>>>>>> Now, at runtime, there's a problem with your ListenerBean.  The
>>>>>>>>>> onMessageExchange method will be used to handle the first
>>>>>>>>>> incoming
>>>>>>>>>> exchange, but it will also get invoked whenever the DONE
>>>>>>>>>> MessageExchange you're sending comes back.  Your code will set
>>>>>>>>>> the
>>>>>>>>>> DONE status on that exchange again, which will cause exceptions.
>>>>>>>>>>  You
>>>>>>>>>> probably want to add a check for if (exchange.getStatus() ==
>>>>>>>>>> ExchangeStatus.ACTIVE) before handling the exchange.
>>>>>>>>>>
>>>>>>>>>> Another option could be to add the bean to the Camel SU.  Since
>>>>>>>>>> you're
>>>>>>>>>> already using Camel in your route, it might be easier to use
>>>>>>>>>> Camel's
>>>>>>>>>> excellent http://camel.apache.org/bean-integration.html instead
>>>>>>>>>> of
>>>>>>>>>> dealing with the JBI MessageExchanges directory from a
>>>>>>>>>> servicemix-bean.
>>>>>>>>>>
>>>>>>>>>> Regards,
>>>>>>>>>>
>>>>>>>>>> Gert Vanthienen
>>>>>>>>>> ------------------------
>>>>>>>>>> Open Source SOA: http://fusesource.com
>>>>>>>>>> Blog: http://gertvanthienen.blogspot.com/
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> View this message in context:
>>>>>>>>> http://old.nabble.com/Servicemix-bean-send-messages-tp26525328p26531243.html
>>>>>>>>> Sent from the ServiceMix - User mailing list archive at
>>>>>>>>> Nabble.com.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> -----
>>>>>>>> ---
>>>>>>>> Gert Vanthienen
>>>>>>>> http://gertvanthienen.blogspot.com
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://old.nabble.com/Servicemix-bean-send-messages-tp26525328p26628850.html
>>>>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>> 
>>>>> 
>>>>> -----
>>>>> ---
>>>>> Gert Vanthienen
>>>>> http://gertvanthienen.blogspot.com
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Servicemix-bean-send-messages-tp26525328p27154049.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Servicemix-bean send messages

Posted by "Michael-P." <Mi...@ses-astra.com>.
Hi,

Thanks for the reply. At the moment I don't really want to get into things
like the pipeline pattern and processors, I just wanted to know how to
communicate between to simple beans.

I've implemented these beans myself and I just wanted to be able to plug
them in and send messages between them. Making use of the ServiceMix
concept.

Do you have any examples regarding the routing via Camel? My problem is the
"from"configuration.

Thanks in advance, best regards

Michael



tranchida wrote:
> 
> Hello,
> 
> You have to use the pipeline pattern
> http://camel.apache.org/pipes-and-filters.html
> But you have to be sure that you servicemix bean support in-out exchange 
> 
> Why to use servicemix-bean ?
> 
> You can do everything with Camel using processor
> http://camel.apache.org/processor.html is more simple.
> 
> Regards
> 
> 
> 
> 
> 
> Michael-P. wrote:
>> 
>> Hi,
>> 
>> does anybody know a solution?
>> 
>> Camel route "from(servicemix-bean).to(another servicemix-bean)"
>> 
>> Please find details in the old posts!
>> 
>> Thanks in advance! Best regards
>> 
>> Michael
>> 
>> 
>> 
>> 
>> Michael-P. wrote:
>>> 
>>> Hi,
>>> 
>>> My problem is, that I want to send a message from the Camel timer to my
>>> ListenerBean. Routed by Camel. From my ListenerBean I want to send
>>> another message to my second bean (MyBean). I would like to configure
>>> this route also in Camel. When I use the following configuration in
>>> Camel I get an exception. I can send you the log file if it helps.
>>> 
>>> How can I configure the "to(...)" and "from(...)" routes in Camel?
>>> 
>>> 
>>> public class MyRouteBuilder extends RouteBuilder {
>>>> 
>>>> 	public void configure() {
>>>> 		
>>>> 		from("timer://tutorial?fixedRate=true&delay=3000&period=10000")
>>>> 	        .setBody(constant("<message>SRQ</message>"))
>>>> 	       
>>>> .to("jbi:endpoint:urn:org:apache:servicemix:example:bean:jms:provider");
>>>>         
>>>> 	       
>>>> from("jbi:endpoint:urn:org:apache:servicemix:example:bean:jms:consumer")
>>>> 	       
>>>> .to("jbi:endpoint:org:apache:servicemix:example:bean:bean:bean1");
>>>>         
>>>> 	       
>>>> from("jbi:endpoint:org:apache:servicemix:example:bean:bean:bean1")
>>>> 	       
>>>> .to("jbi:endpoint:org:apache:servicemix:example:bean2:bean:bean2");
>>>> 	}
>>>> }
>>> 
>>> Many thanks in advance, best regards
>>> 
>>> Michael Preuß
>>> 
>>> 
>>> Gert Vanthienen wrote:
>>>> 
>>>> Michael,
>>>> 
>>>> Everytime you start route with from("jbi:..."), you get a new endpoint
>>>> you can use to send exchanges to.  Your ListenerBean already has the
>>>> necessary code to send to an endpoint with service name
>>>> {org:apache:servicemix:example:bean2}bean.  To create this endpoint
>>>> from a Camel route, you would have to create a route that starts with
>>>> from('jbi:service:org:apache:servicemix:example:bean2:bean")...
>>>> 
>>>> If you want to create a route that sits between the existing
>>>> ListenerBean and the bean2 endpoint, you have to add another endpoint
>>>> in the middle.  E.g. you camel route could look like:
>>>> from('jbi:endpoint:urn:test:service:endpoint").to("jbi:service:org:apache:servicemix:example:bean2:bean");
>>>> 
>>>> The code in your ListenerBean would then look like this:
>>>> InOnly sendExchange = ...
>>>> sendExchange.setService(new QName("urn:test", "service");
>>>> 
>>>> Regards,
>>>> 
>>>> Gert Vanthienen
>>>> ------------------------
>>>> Open Source SOA: http://fusesource.com
>>>> Blog: http://gertvanthienen.blogspot.com/
>>>> 
>>>> 
>>>> 
>>>> 2009/12/3 Michael-P. <Mi...@ses-astra.com>:
>>>>>
>>>>> Hi again,
>>>>>
>>>>> I solved the problem, but not in my preferred way.
>>>>> At the moment I use the Camel RouteBuilder (Code:
>>>>> http://old.nabble.com/file/p26628850/MyRouteBuilder.java
>>>>> MyRouteBuilder.java
>>>>> ) to send a message from the Camel timer to a JMS Queue and from there
>>>>> to
>>>>> one of my servicemix-bean components.
>>>>> In the onMessageExchange method I create another Exchange and send it
>>>>> to a
>>>>> second servicemix-bean component (Code:
>>>>> http://old.nabble.com/file/p26628850/ListenerBean.java
>>>>> ListenerBean.java ).
>>>>> The second bean just prints out the message (Code:
>>>>> http://old.nabble.com/file/p26628850/MyBean.java MyBean.java ).
>>>>>
>>>>> This works but it would be nice if I would configure the route for the
>>>>> message in the Camel RouteBuilder. Unfortunately I didn't find an
>>>>> example
>>>>> which shows me the way to do it.
>>>>>
>>>>> I would like to have:
>>>>>
>>>>> public void configure(){
>>>>>
>>>>>   ...
>>>>>
>>>>>   from(bean1)             <-- What should be typed in here (The URI of
>>>>> bean1 is wrong)
>>>>>   .to(URI of bean2);
>>>>>
>>>>> }
>>>>>
>>>>> Does anybody know how to do it?
>>>>>
>>>>> Thanks in advance, best regards
>>>>>
>>>>>    Michael Preuß
>>>>>
>>>>>
>>>>> Michael-P. wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> you're right about the endpoints being the same and I want to start a
>>>>>> new
>>>>>> MessageExchange from within my bean.
>>>>>> I want to send a message from the servicemix-bean to another
>>>>>> component (In
>>>>>> my example to the camel logging service). I guess the problem is to
>>>>>> configure the route in the Camel RouteBuilder from my bean to the
>>>>>> camel
>>>>>> logging service. Forget all my code and explanations, what do I have
>>>>>> to
>>>>>> use (URI) in the from definition in the Camel RouteBuilder when I
>>>>>> want to
>>>>>> route a message exchange from my servicemix-bean to wherever?
>>>>>>
>>>>>> Additionally have you an example which showes the servicemix-bean
>>>>>> code to
>>>>>> send a message out? I found this page:
>>>>>> http://servicemix.apache.org/client-api.html, but the client API link
>>>>>> leads to a completely different page and I don't know how I have to
>>>>>> create
>>>>>> the "client" object (where can I get the "context" object?).
>>>>>>
>>>>>>
>>>>>> Gert Vanthienen wrote:
>>>>>>>
>>>>>>> Michael,
>>>>>>>
>>>>>>> First of all, sorry it took me so long to get back to you.
>>>>>>>
>>>>>>> After taking another look at this, I think I'm beginning to see
>>>>>>> where
>>>>>>> the problem is.  I'm guessing you have a servicemix-bean endpoint
>>>>>>> that's called {org.apache.servicemix.bean}bean and you want to log
>>>>>>> everything that's going to that endpoint, right?
>>>>>>>
>>>>>>> Now, whever you start to a Camel route with from("jbi:..."), the
>>>>>>> endpoint referred to in the from will itself become an endpoint on
>>>>>>> the
>>>>>>> NMR.  So, by doing this, you get a duplicate name (one for the
>>>>>>> servicemix-bean endpoint and another for the from(jbi:).
>>>>>>>
>>>>>>> If you just want to log the message that is going to/from the bean
>>>>>>> endpoint, you can alter the route just before that
>>>>>>> from("jbi:endpoint:urn:org:apache:servicemix:example:bean:jms:consumer")
>>>>>>> .to("log:before-bean)
>>>>>>> .to("jbi:endpoint:org:apache:servicemix:example:bean:bean:endpoint")
>>>>>>> .to("log:after-bean);
>>>>>>>
>>>>>>> If, on the other hand, you want to start a new MessageExchange from
>>>>>>> within the bean and send that to the Camel route with the log:
>>>>>>> endpoint, you have to make sure the name of that endpoint is
>>>>>>> different
>>>>>>> than the name of your bean endpoint itself.  Upon sending the
>>>>>>> exchange
>>>>>>> to the log route, you can set the target service to be that you
>>>>>>> specified in the from("jbi:...") for the log route.
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> Gert Vanthienen
>>>>>>> ------------------------
>>>>>>> Open Source SOA: http://fusesource.com
>>>>>>> Blog: http://gertvanthienen.blogspot.com/
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 2009/11/26 Michael-P. <Mi...@ses-astra.com>:
>>>>>>>>
>>>>>>>> Hello
>>>>>>>>
>>>>>>>> Many thanks for your tips. For me all attached files are available
>>>>>>>> when
>>>>>>>> I
>>>>>>>> click on the links. :confused:
>>>>>>>>
>>>>>>>> I deleted all entries in the data directory and added the if ACTIVE
>>>>>>>> check,
>>>>>>>> but that solved not the problem.
>>>>>>>>
>>>>>>>> I found that the error occurs when try to configure a route in the
>>>>>>>> Camel
>>>>>>>> RouteBuilder from the servicemix-bean to the log:XXX service.
>>>>>>>>
>>>>>>>> public void configure() {
>>>>>>>>
>>>>>>>>        
>>>>>>>>  from("timer://tutorial?fixedRate=true&delay=3000&period=10000")
>>>>>>>>         .setBody(constant("<message>SRQ</message>"))
>>>>>>>>
>>>>>>>> .to("jbi:endpoint:urn:org:apache:servicemix:example:bean:jms:provider");
>>>>>>>>
>>>>>>>>
>>>>>>>> from("jbi:endpoint:urn:org:apache:servicemix:example:bean:jms:consumer")
>>>>>>>>
>>>>>>>> .to("jbi:endpoint:org:apache:servicemix:example:bean:bean:endpoint");
>>>>>>>>
>>>>>>>>
>>>>>>>> from("jbi:endpoint:org:apache:servicemix:example:bean:bean:endpoint")
>>>>>>>>         .to("log:beanExample");
>>>>>>>> }
>>>>>>>>
>>>>>>>> Did I here a mistake? I'm wondering to use an endpoint in the from
>>>>>>>> definition but I find no example to configure something more in the
>>>>>>>> servicemix-bean xbean.xml file.
>>>>>>>>
>>>>>>>> Again, many thanks in advance!
>>>>>>>>
>>>>>>>>
>>>>>>>> Best regards
>>>>>>>>
>>>>>>>> Michael Preuß
>>>>>>>>
>>>>>>>>
>>>>>>>> Gert Vanthienen wrote:
>>>>>>>>>
>>>>>>>>> L.S.,
>>>>>>>>>
>>>>>>>>> The exception you posted in the mailing list indicates that two
>>>>>>>>> endpoints are being configured with the same name.  I haven't
>>>>>>>>> found
>>>>>>>>> the duplicate name in you own configuration at first glance (some
>>>>>>>>> of
>>>>>>>>> the links you posted seem to be no longer available), so it might
>>>>>>>>> just
>>>>>>>>> be a consequence of a failed deployment.  Could you try stopping
>>>>>>>>> servicemix, deleting the entire data directory and then restart
>>>>>>>>> the
>>>>>>>>> ESB to see if you get a clean deploy then?
>>>>>>>>>
>>>>>>>>> Now, at runtime, there's a problem with your ListenerBean.  The
>>>>>>>>> onMessageExchange method will be used to handle the first incoming
>>>>>>>>> exchange, but it will also get invoked whenever the DONE
>>>>>>>>> MessageExchange you're sending comes back.  Your code will set the
>>>>>>>>> DONE status on that exchange again, which will cause exceptions.
>>>>>>>>>  You
>>>>>>>>> probably want to add a check for if (exchange.getStatus() ==
>>>>>>>>> ExchangeStatus.ACTIVE) before handling the exchange.
>>>>>>>>>
>>>>>>>>> Another option could be to add the bean to the Camel SU.  Since
>>>>>>>>> you're
>>>>>>>>> already using Camel in your route, it might be easier to use
>>>>>>>>> Camel's
>>>>>>>>> excellent http://camel.apache.org/bean-integration.html instead of
>>>>>>>>> dealing with the JBI MessageExchanges directory from a
>>>>>>>>> servicemix-bean.
>>>>>>>>>
>>>>>>>>> Regards,
>>>>>>>>>
>>>>>>>>> Gert Vanthienen
>>>>>>>>> ------------------------
>>>>>>>>> Open Source SOA: http://fusesource.com
>>>>>>>>> Blog: http://gertvanthienen.blogspot.com/
>>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> View this message in context:
>>>>>>>> http://old.nabble.com/Servicemix-bean-send-messages-tp26525328p26531243.html
>>>>>>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> -----
>>>>>>> ---
>>>>>>> Gert Vanthienen
>>>>>>> http://gertvanthienen.blogspot.com
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://old.nabble.com/Servicemix-bean-send-messages-tp26525328p26628850.html
>>>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>> 
>>>> 
>>>> -----
>>>> ---
>>>> Gert Vanthienen
>>>> http://gertvanthienen.blogspot.com
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Servicemix-bean-send-messages-tp26525328p27145240.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Servicemix-bean send messages

Posted by tranchida <gi...@tranchida.ch>.
Hello,

You have to use the pipeline pattern
http://camel.apache.org/pipes-and-filters.html
But you have to be sure that you servicemix bean support in-out exchange 

Why to use servicemix-bean ?

You can do everything with Camel using processor
http://camel.apache.org/processor.html is more simple.

Regards





Michael-P. wrote:
> 
> Hi,
> 
> does anybody know a solution?
> 
> Camel route "from(servicemix-bean).to(another servicemix-bean)"
> 
> Please find details in the old posts!
> 
> Thanks in advance! Best regards
> 
> Michael
> 
> 
> 
> 
> Michael-P. wrote:
>> 
>> Hi,
>> 
>> My problem is, that I want to send a message from the Camel timer to my
>> ListenerBean. Routed by Camel. From my ListenerBean I want to send
>> another message to my second bean (MyBean). I would like to configure
>> this route also in Camel. When I use the following configuration in Camel
>> I get an exception. I can send you the log file if it helps.
>> 
>> How can I configure the "to(...)" and "from(...)" routes in Camel?
>> 
>> 
>> public class MyRouteBuilder extends RouteBuilder {
>>> 
>>> 	public void configure() {
>>> 		
>>> 		from("timer://tutorial?fixedRate=true&delay=3000&period=10000")
>>> 	        .setBody(constant("<message>SRQ</message>"))
>>> 	       
>>> .to("jbi:endpoint:urn:org:apache:servicemix:example:bean:jms:provider");
>>>         
>>> 	       
>>> from("jbi:endpoint:urn:org:apache:servicemix:example:bean:jms:consumer")
>>> 	       
>>> .to("jbi:endpoint:org:apache:servicemix:example:bean:bean:bean1");
>>>         
>>> 	       
>>> from("jbi:endpoint:org:apache:servicemix:example:bean:bean:bean1")
>>> 	       
>>> .to("jbi:endpoint:org:apache:servicemix:example:bean2:bean:bean2");
>>> 	}
>>> }
>> 
>> Many thanks in advance, best regards
>> 
>> Michael Preuß
>> 
>> 
>> Gert Vanthienen wrote:
>>> 
>>> Michael,
>>> 
>>> Everytime you start route with from("jbi:..."), you get a new endpoint
>>> you can use to send exchanges to.  Your ListenerBean already has the
>>> necessary code to send to an endpoint with service name
>>> {org:apache:servicemix:example:bean2}bean.  To create this endpoint
>>> from a Camel route, you would have to create a route that starts with
>>> from('jbi:service:org:apache:servicemix:example:bean2:bean")...
>>> 
>>> If you want to create a route that sits between the existing
>>> ListenerBean and the bean2 endpoint, you have to add another endpoint
>>> in the middle.  E.g. you camel route could look like:
>>> from('jbi:endpoint:urn:test:service:endpoint").to("jbi:service:org:apache:servicemix:example:bean2:bean");
>>> 
>>> The code in your ListenerBean would then look like this:
>>> InOnly sendExchange = ...
>>> sendExchange.setService(new QName("urn:test", "service");
>>> 
>>> Regards,
>>> 
>>> Gert Vanthienen
>>> ------------------------
>>> Open Source SOA: http://fusesource.com
>>> Blog: http://gertvanthienen.blogspot.com/
>>> 
>>> 
>>> 
>>> 2009/12/3 Michael-P. <Mi...@ses-astra.com>:
>>>>
>>>> Hi again,
>>>>
>>>> I solved the problem, but not in my preferred way.
>>>> At the moment I use the Camel RouteBuilder (Code:
>>>> http://old.nabble.com/file/p26628850/MyRouteBuilder.java
>>>> MyRouteBuilder.java
>>>> ) to send a message from the Camel timer to a JMS Queue and from there
>>>> to
>>>> one of my servicemix-bean components.
>>>> In the onMessageExchange method I create another Exchange and send it
>>>> to a
>>>> second servicemix-bean component (Code:
>>>> http://old.nabble.com/file/p26628850/ListenerBean.java
>>>> ListenerBean.java ).
>>>> The second bean just prints out the message (Code:
>>>> http://old.nabble.com/file/p26628850/MyBean.java MyBean.java ).
>>>>
>>>> This works but it would be nice if I would configure the route for the
>>>> message in the Camel RouteBuilder. Unfortunately I didn't find an
>>>> example
>>>> which shows me the way to do it.
>>>>
>>>> I would like to have:
>>>>
>>>> public void configure(){
>>>>
>>>>   ...
>>>>
>>>>   from(bean1)             <-- What should be typed in here (The URI of
>>>> bean1 is wrong)
>>>>   .to(URI of bean2);
>>>>
>>>> }
>>>>
>>>> Does anybody know how to do it?
>>>>
>>>> Thanks in advance, best regards
>>>>
>>>>    Michael Preuß
>>>>
>>>>
>>>> Michael-P. wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> you're right about the endpoints being the same and I want to start a
>>>>> new
>>>>> MessageExchange from within my bean.
>>>>> I want to send a message from the servicemix-bean to another component
>>>>> (In
>>>>> my example to the camel logging service). I guess the problem is to
>>>>> configure the route in the Camel RouteBuilder from my bean to the
>>>>> camel
>>>>> logging service. Forget all my code and explanations, what do I have
>>>>> to
>>>>> use (URI) in the from definition in the Camel RouteBuilder when I want
>>>>> to
>>>>> route a message exchange from my servicemix-bean to wherever?
>>>>>
>>>>> Additionally have you an example which showes the servicemix-bean code
>>>>> to
>>>>> send a message out? I found this page:
>>>>> http://servicemix.apache.org/client-api.html, but the client API link
>>>>> leads to a completely different page and I don't know how I have to
>>>>> create
>>>>> the "client" object (where can I get the "context" object?).
>>>>>
>>>>>
>>>>> Gert Vanthienen wrote:
>>>>>>
>>>>>> Michael,
>>>>>>
>>>>>> First of all, sorry it took me so long to get back to you.
>>>>>>
>>>>>> After taking another look at this, I think I'm beginning to see where
>>>>>> the problem is.  I'm guessing you have a servicemix-bean endpoint
>>>>>> that's called {org.apache.servicemix.bean}bean and you want to log
>>>>>> everything that's going to that endpoint, right?
>>>>>>
>>>>>> Now, whever you start to a Camel route with from("jbi:..."), the
>>>>>> endpoint referred to in the from will itself become an endpoint on
>>>>>> the
>>>>>> NMR.  So, by doing this, you get a duplicate name (one for the
>>>>>> servicemix-bean endpoint and another for the from(jbi:).
>>>>>>
>>>>>> If you just want to log the message that is going to/from the bean
>>>>>> endpoint, you can alter the route just before that
>>>>>> from("jbi:endpoint:urn:org:apache:servicemix:example:bean:jms:consumer")
>>>>>> .to("log:before-bean)
>>>>>> .to("jbi:endpoint:org:apache:servicemix:example:bean:bean:endpoint")
>>>>>> .to("log:after-bean);
>>>>>>
>>>>>> If, on the other hand, you want to start a new MessageExchange from
>>>>>> within the bean and send that to the Camel route with the log:
>>>>>> endpoint, you have to make sure the name of that endpoint is
>>>>>> different
>>>>>> than the name of your bean endpoint itself.  Upon sending the
>>>>>> exchange
>>>>>> to the log route, you can set the target service to be that you
>>>>>> specified in the from("jbi:...") for the log route.
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Gert Vanthienen
>>>>>> ------------------------
>>>>>> Open Source SOA: http://fusesource.com
>>>>>> Blog: http://gertvanthienen.blogspot.com/
>>>>>>
>>>>>>
>>>>>>
>>>>>> 2009/11/26 Michael-P. <Mi...@ses-astra.com>:
>>>>>>>
>>>>>>> Hello
>>>>>>>
>>>>>>> Many thanks for your tips. For me all attached files are available
>>>>>>> when
>>>>>>> I
>>>>>>> click on the links. :confused:
>>>>>>>
>>>>>>> I deleted all entries in the data directory and added the if ACTIVE
>>>>>>> check,
>>>>>>> but that solved not the problem.
>>>>>>>
>>>>>>> I found that the error occurs when try to configure a route in the
>>>>>>> Camel
>>>>>>> RouteBuilder from the servicemix-bean to the log:XXX service.
>>>>>>>
>>>>>>> public void configure() {
>>>>>>>
>>>>>>>        
>>>>>>>  from("timer://tutorial?fixedRate=true&delay=3000&period=10000")
>>>>>>>         .setBody(constant("<message>SRQ</message>"))
>>>>>>>
>>>>>>> .to("jbi:endpoint:urn:org:apache:servicemix:example:bean:jms:provider");
>>>>>>>
>>>>>>>
>>>>>>> from("jbi:endpoint:urn:org:apache:servicemix:example:bean:jms:consumer")
>>>>>>>
>>>>>>> .to("jbi:endpoint:org:apache:servicemix:example:bean:bean:endpoint");
>>>>>>>
>>>>>>>
>>>>>>> from("jbi:endpoint:org:apache:servicemix:example:bean:bean:endpoint")
>>>>>>>         .to("log:beanExample");
>>>>>>> }
>>>>>>>
>>>>>>> Did I here a mistake? I'm wondering to use an endpoint in the from
>>>>>>> definition but I find no example to configure something more in the
>>>>>>> servicemix-bean xbean.xml file.
>>>>>>>
>>>>>>> Again, many thanks in advance!
>>>>>>>
>>>>>>>
>>>>>>> Best regards
>>>>>>>
>>>>>>> Michael Preuß
>>>>>>>
>>>>>>>
>>>>>>> Gert Vanthienen wrote:
>>>>>>>>
>>>>>>>> L.S.,
>>>>>>>>
>>>>>>>> The exception you posted in the mailing list indicates that two
>>>>>>>> endpoints are being configured with the same name.  I haven't found
>>>>>>>> the duplicate name in you own configuration at first glance (some
>>>>>>>> of
>>>>>>>> the links you posted seem to be no longer available), so it might
>>>>>>>> just
>>>>>>>> be a consequence of a failed deployment.  Could you try stopping
>>>>>>>> servicemix, deleting the entire data directory and then restart the
>>>>>>>> ESB to see if you get a clean deploy then?
>>>>>>>>
>>>>>>>> Now, at runtime, there's a problem with your ListenerBean.  The
>>>>>>>> onMessageExchange method will be used to handle the first incoming
>>>>>>>> exchange, but it will also get invoked whenever the DONE
>>>>>>>> MessageExchange you're sending comes back.  Your code will set the
>>>>>>>> DONE status on that exchange again, which will cause exceptions.
>>>>>>>>  You
>>>>>>>> probably want to add a check for if (exchange.getStatus() ==
>>>>>>>> ExchangeStatus.ACTIVE) before handling the exchange.
>>>>>>>>
>>>>>>>> Another option could be to add the bean to the Camel SU.  Since
>>>>>>>> you're
>>>>>>>> already using Camel in your route, it might be easier to use
>>>>>>>> Camel's
>>>>>>>> excellent http://camel.apache.org/bean-integration.html instead of
>>>>>>>> dealing with the JBI MessageExchanges directory from a
>>>>>>>> servicemix-bean.
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>>
>>>>>>>> Gert Vanthienen
>>>>>>>> ------------------------
>>>>>>>> Open Source SOA: http://fusesource.com
>>>>>>>> Blog: http://gertvanthienen.blogspot.com/
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://old.nabble.com/Servicemix-bean-send-messages-tp26525328p26531243.html
>>>>>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> -----
>>>>>> ---
>>>>>> Gert Vanthienen
>>>>>> http://gertvanthienen.blogspot.com
>>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/Servicemix-bean-send-messages-tp26525328p26628850.html
>>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>>
>>>>
>>> 
>>> 
>>> -----
>>> ---
>>> Gert Vanthienen
>>> http://gertvanthienen.blogspot.com
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Servicemix-bean-send-messages-tp26525328p27141656.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.