How to update Camel exchange message body inside Camel Route running inside SwitchYard ?
Issue
- How to update a
Camel Exchange message body
depending on a certain value retrieved from theCamel message body
(exchange) inside aCamel XML route
?
e.g.
<choice>
<when>
<simple>${body.prop1} == 'TEST'</simple>
body.prop2="TEST"
<to uri="switchyard://SimpleService?operationName=simpleOperation" />
</when>
</choice>
- Just to clarify the requirement here is what is expected from this use case.
- User is trying to run the aforementioned
Camel route (XML)
from inside a Camel Component of SwitchYard application. - Inside the Camel route (XML) user wants to analyze the body part of the incoming Camel Exchange message , which are in key-value pair.
- Now inside the same route user is checking if inside the same message body if a key named
prop1
contains value asTEST
, then it would update the value of another keyprop2
found inside the same message with value 'TEST' .
-
If the incoming and outgoing message inside
Camel route
is inJSON
format, what would be the way to change the value as per above requirement?
To clarify the requirement further, user wants to sendJSON
requests to theREST composite binding
of theSwitchYard
application and receive updatedJSON response
. -
Also, is there a way to implement the above mentioned requirement all inside the
Camel Route
itself, not from any other bean or external classes?
Environment
- Red Hat JBoss Fuse Service Works (FSW)
- 6.0.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.