Frederic, In ServiceMix 3, you can not set another endpoint on the MessageExchange and just send it along to the next hop. Performing routing using servicemix-bean would involve creating a new MessageExchange and sending that through the NMR and, if it's an InOut exchange, afterwards receiving the response and responding to the original MessageExchange. We do have some helper classes about to ease creating such services a bit. There's e.g. the TransformBeanSupport class you can extends to just transform a message and send it along to the next endpoint.
If you want do more of the work yourself, for simple uses cases we have Destination interface which allows you to call another service and wait for the reponse -- you can find an example on how to use that in the ConsumerBean sample mentioned on http://servicemix.apache.org/servicemix-bean.html. For a more complex scenario, you probably want to interact with the DeliveryChannel directly or through the ServiceMix Client API as explained on the same wiki page. If you can tell us a bit more about the use case you're trying to implement, we might be able to redirect you to a unit test or something that a more adequate code example to work with. As you mentioned, Camel would be a nice way to solve this problem in most projects. It also has very good ways of using plain POJOs to do routing, transformation, ... Regards, Gert Vanthienen ------------------------ Open Source SOA: http://fusesource.com Blog: http://gertvanthienen.blogspot.com/ 2009/3/23 Frederic Tuttle <[email protected]>: > I am looking for an example of how to perform routing using > servicemix-bean. It's probably easier to use camel, but I prefer to try > this with a pojo first. I have a consumer cxf bc pointing to a custom > router pojo se and I'd like to route the exchange to one of several > implementations (se) of the same service using an external criteria. I would > like to handle several services with the same router se. Do I set a new > endpoint on the exchange when I process it in the router se ? Do I need to > handle the return message in the router se ? Am I even on the right track > ? Better yet, Is there a hook in the NMR to handle custom routing ? > > Thanks for your help. > > -FT >
