How to use Camel Quartz clusters in tandem with queue consumption?

Using Apache 2.11.0 here. I am writing a small Camel-based application (using Spring XML) that spends messages from the queue ( inputQueue), aggregates them, processes the aggregated batch, and then sends the generated report. I would like to deploy this application ( widget-reporter.war) for several instances of Tomcat and group them so that if one node is omitted, it still works on the other nodes and the report will still be generated.

So far, the route pseudo-code is as follows:

<camelContext id="myCamel" xmlns="http://camel.apache.org/schema/spring">
    <route id="myRoute">
        <from uri="activemq:queue:inputQueue" />
        <aggregate strategyRef="myStrategy" completionSize="500">
            <correlationExpression>
                <xpath>/fizz/buzz</xpath>
            </correlationExpression>
            <to uri="bean:reportGenerator?method=runReport"/>
        </aggregate>
    </route>
</camelContext>

, , inputQueue, ( xpath), 500 reportGenerator.

(1 node). Tomcat, , 1 node . , , 5 Tomcat, , 5 Tomcats inputQueue : 1 , 4 , .

, Camel Quartz ​​, , , quartz://, activemq. - ( ):

<route id="myRoute">
    <from uri="quartz://runWidgetReporterExclusively?cron=0+15,45+0-16+?+*+SAT" />

    <!-- Can't have 2 consecutive "from" endpoints... -->
    <from uri="activemq:queue:inputQueue" />

    <aggregate strategyRef="myStrategy" completionSize="500">
        <correlationExpression>
            <xpath>/fizz/buzz</xpath>
        </correlationExpression>
        <to uri="bean:reportGenerator?method=runReport"/>
    </aggregate>
</route>

- , :

  • Camel-Quartz , , ?;
  • 1- node -at-a-time Java/Camel, Camel-Quartz?
+3
2

camel-zookeeper RoutePolicy ...

ZooKeeper ; RoutePolicy , . , Camel. "-", , , , , . , , .

+2

, ...

( ), a sticky . , , "". xpath .

, Camel Tomcat. Camel , Tomcat, Camel ; - . Camel , org.apache.camel.spring.Main spring .

0

All Articles