I have a service that has two operations.
RegisterUser UpdateUser
I have a camel route:
<camel:route id="myRoute"> <camel:from uri="cxf:bean:myListenerEndpoint?dataFormat=POJO&synchronous=true" /> <camel:bean ref="processor" method="processMessage"/> <camel:to uri="xslt:file:resources/service/2.0.0/UserRegistration.xsl"/> <camel:to uri="cxf:bean:myTargetEndpoint"/> </camel:route>
In my bean processor, when I specify:
RegisterUser registerUser = exchange.getIn().getBody(RegisterUser.class);
I get a registry user object. Everything is working fine. The problem is that I want the camel to request my request conditionally, for example, for example:
If the operation is a RegisterUser service, I want to redirect the message to my specific bean, and if the operation is UpdateUser , I want to redirect the message to another bean.
I tried using camel xPath, but it does not work.
<camel:route id="myRoute"> <camel:from uri="cxf:bean:myListenerEndpoint?dataFormat=POJO&synchronous=true" /> <camel:choice> <camel:when> <camel:xpath> //RegisterUser </camel:xpath> <camel:bean ref="processor" method="processMessage"/> <camel:to uri="xslt:file:resources/service/2.0.0/UserRegistration.xsl"/> </camel:when> </camel:choice> <camel:to uri="cxf:bean:myTargetEndpoint"/> </camel:route>
I was looking for how to set up a camel to route for different purposes, but found nothing. Maybe someone knows where the problem might be?
Paulius matulionis
source share