Re: Parse Json inside RecipientList

2016-09-30 Thread Brad Johnson
OK, cool. Glad that worked for you. I usually use a header simply because it passes from route to route while the properties do not. But in this case, the use of the properties is probably better since you don't need the property to go anywhere else. But glad you got it working. On Thu, Sep 29, 2

Re: Parse Json inside RecipientList

2016-09-29 Thread Shabin5785
OK got it.. I added it as a property on exchange. Ranx wrote > There are a number of ways but perhaps the simplest would be something > like: > > .setHeader("customerId","${body.id}") > > right before the marshaling. Then in the http statement where the ID goes > you can fish it out of the he

Re: Parse Json inside RecipientList

2016-09-28 Thread Brad Johnson
There are a number of ways but perhaps the simplest would be something like: .setHeader("customerId","${body.id}") right before the marshaling. Then in the http statement where the ID goes you can fish it out of the header with something like ${header.customerId}. I wrote all that free hand jus

Re: Parse Json inside RecipientList

2016-09-28 Thread Shabin5785
sparekh wrote > If the jms message is a serialized POJO then you can use the Camel OGNL > expression to grab the id via body.id before marshalling it to JSON. > > Thanks, > sparekh Message is a serialized pojo. If i extract the id before marshalling, how can i hand it over to the next stage? -

Re: Parse Json inside RecipientList

2016-09-28 Thread Brad Johnson
To amplify on sparekh's answer I think with a POJO you could simply use: "https4://x/api/customer/${body.id}" On Wed, Sep 28, 2016 at 11:49 AM, sparekh wrote: > How about a custom processor that parses the JSON string (via GSON) into a > JSON object and sets up the HTTP request and headers.

Re: Parse Json inside RecipientList

2016-09-28 Thread sparekh
How about a custom processor that parses the JSON string (via GSON) into a JSON object and sets up the HTTP request and headers. I don't believe you can use JsonPath to extract values, just choice or filter them. The custom processor would translate String -> JSON Object, extract the id from JSON