Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EC47C174DF for ; Mon, 10 Nov 2014 16:21:42 +0000 (UTC) Received: (qmail 21293 invoked by uid 500); 10 Nov 2014 16:21:42 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 21245 invoked by uid 500); 10 Nov 2014 16:21:42 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Delivered-To: moderator for users@camel.apache.org Received: (qmail 83213 invoked by uid 99); 10 Nov 2014 15:43:28 -0000 X-ASF-Spam-Status: No, hits=2.3 required=5.0 tests=SPF_HELO_PASS,SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of gordonwho@gmail.com does not designate 162.253.133.43 as permitted sender) Date: Mon, 10 Nov 2014 08:43:02 -0700 (MST) From: gmh To: users@camel.apache.org Message-ID: <1415634182801-5758838.post@n5.nabble.com> Subject: how to process json and dispatch to several processors MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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.