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 9963FEEBD for ; Tue, 25 Jun 2013 20:46:47 +0000 (UTC) Received: (qmail 42259 invoked by uid 500); 25 Jun 2013 20:46:47 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 42228 invoked by uid 500); 25 Jun 2013 20:46:47 -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 Received: (qmail 42220 invoked by uid 99); 25 Jun 2013 20:46:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Jun 2013 20:46:47 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of seanmckaybeck@gmail.com designates 74.125.83.49 as permitted sender) Received: from [74.125.83.49] (HELO mail-ee0-f49.google.com) (74.125.83.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Jun 2013 20:46:42 +0000 Received: by mail-ee0-f49.google.com with SMTP id b57so6985460eek.22 for ; Tue, 25 Jun 2013 13:46:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=jYAijYkeBPswEeCdAnkjNwjf25pCaxLy4Q31X14CDkU=; b=idX3oMZhG951E9KQuU1qo37qDzSBMOorRSs463iBKecBQ5x8/yjh1kGUZW/FxZVEEQ r1gP9he1NN+YAi0rhR8/sX/QPozE39th4xio3BYTw4KR6v1ga0nFk9g6euOfcP4GHTvP RplncXHxFHdQX2qUlmeUwbNJG9s57oc6o18v9x3YAmIhKivTb59IhpPvp7Ba1YM7CWlT G60B7RG5ttxO2DbBQ6SB8t6xVCZ8tObX/qP/Vq611WF9g/cfkVrcuTR+9LrBwUvtbGDW MDAd4b4uQfSARvVh8XCwZs3ajoFJNRUm/tHOL3mhRpkjP4ow11067enAjLBOsp9WymZW AgPQ== MIME-Version: 1.0 X-Received: by 10.14.103.196 with SMTP id f44mr794976eeg.37.1372193180851; Tue, 25 Jun 2013 13:46:20 -0700 (PDT) Received: by 10.14.118.6 with HTTP; Tue, 25 Jun 2013 13:46:20 -0700 (PDT) In-Reply-To: <51C4BB73.6030304@gmail.com> References: <51C49A7B.90305@gmail.com> <51C4BB73.6030304@gmail.com> Date: Tue, 25 Jun 2013 14:46:20 -0600 Message-ID: Subject: Re: How to start a process with Camel? From: Sean Beck To: users@camel.apache.org Content-Type: multipart/alternative; boundary=001a11c275a01bc28804e0009f9d X-Virus-Checked: Checked by ClamAV on apache.org --001a11c275a01bc28804e0009f9d Content-Type: text/plain; charset=ISO-8859-1 So I have some code I've tried writing and I think it solves the problem. I just want to check to make sure I'm not goofing anything up. Also, in AggregationStrategy.aggregate() what exchange should I return from what I have? public static void main(String args[]) { CamelContext c = new DefaultCamelContext(); ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false"); context.addComponent("jms", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory)); context.addRoutes(new RouteBuilder() { public void configure() { from("jms:analytics.camelqueue").aggregate(new MyAggregationStrategy()).header("subject").completionSize(2).to("exec://FILEPATH?args="); } }); context.start(); } private static class MyAggregationStrategy implements AggregationStrategy { public Exchange aggregate(Exchange oldExchange, Exchange newExchange) { if (oldExchange == null) return newExchange; // and here is where combo stuff goes String oldBody = oldExchange.getIn().getBody(String.class); String newBody = newExchange.getIn().getBody(String.class); boolean oldSet = oldBody.contains("set"); boolean newSet = newBody.contains("set"); boolean oldFlow = oldBody.contains("flow"); boolean newFlow = newBody.contains("flow"); if ( (oldSet && newFlow) || (oldFlow && newSet) ) { //they match so start extractor then return } else { // no match so do something.... } --001a11c275a01bc28804e0009f9d--