Oh and your use-case may seem a bit like this eip http://camel.apache.org/composed-message-processor.html
You can more easily do this using the splitter only, so see the _splitter only_ section on that page On Mon, Nov 10, 2014 at 4:43 PM, gmh <[email protected]> wrote: > All, > I have a simple use case I am trying to implement. > We will be receiving data from websocket. > I am thinking about using poll consumer pattern to test for now. > Essentially I will have the following json coming thru the activemq queue. > > {name: abc > address: xyz > } > > Where the json does not really matter but how I dispatch the data to > different components is what I am looking for. > I need to be able to rout the json data to different components. I am > thinking about using jsonpath. > > Something like this? > > from("direct:type") > .choice() > > .when(PredicateBuilder.isEqualTo(ExpressionBuilder.languageExpression("jsonpath", > "$.kind"), ExpressionBuilder.constantExpression("full"))) > .to("mock:full") > .otherwise() > .to("mock:empty"); > } > > But the components will be the same just need t send the value of name > (example above) to some component that will do the processing (calling the > db to do some querying) > So essentially this is the work flow. > > Receive a json > Read the json and dispatch the value of the json to some processor to do > some type of querying against the database (find name in db) . Do this for > each json name:value pair (json wil not change, will always have the same > name:value pairs) Combine the result for each name:value pair. > > Any pointers/ideas as how to implement this type of processing? What kind of > patterns should I implement? Any simple code snippets to illustrate the > points. > I am also thinking about leveraging Akka for this pattern as well since we > have potentially many millions of records and will need to ensure the > processing is done per json and concurrency is guaranteed. > Thanks, > Gordon > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/how-to-process-json-and-dispatch-to-several-processors-tp5758838.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/
