camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Aggregator strategy and killing the process
Date Sat, 24 Oct 2009 07:02:13 GMT
Hi

We do have on the roadmap to overhaul the aggregator in Camel to
support persistence.
There are a couple of JIRA tickets assigned for Camel 2.2.

Help is much appreciated so in case you start on it first we love
feedback and contributions.

Otherwise you can always roll out your own processor where you can
implement logic to store the aggregated messages.
And then use your own processor in the route instead of the build in
aggregate EIP from Camel.


On Sat, Oct 24, 2009 at 2:10 AM, Monica_G <mgranbois@gmail.com> wrote:
>
> Hi,
>
> I'm wondering if it is possible to recover from the case where someone
> Cntrl-Cs a process that uses an aggregator.
>
> For example, I have an aggregator with a batchTimout set to 5 minutes.  If
> someone Cntrl-C's the program at 2 minutes, the messages that have been
> consumed up to that point are lost as they have been consumed off the queue,
> but not sent onto the destination.
>
> I'm looking into using transacted() but haven't had any luck so far.
>
> Here is what I am doing in my RouteBuilder:
>
> from(inputEndpoint)
>            .policy(jmsTransactionPolicy)
>            .transacted()
>            .unmarshal().xstream()
>            .aggregate(header("my_id"), new MyListAggregationStrategy())
>            .batchTimeout(batchTimeout)
>            .batchSize(0)
>            .marshal().xstream().convertBodyTo(String.class)
>            .to(destinationEndpoint);
>
>
> my xml config looks like the following:
>
>  <bean id="myBroker" class="org.apache.camel.component.jms.JmsComponent">
>    <property name="connectionFactory" ref="jndiConnectionFactory"/>
>    <property name="destinationResolver" ref="jmsDestinationResolver"/>
>    <property name="transacted" value="true"/>
>    <property name="transactionManager" ref="jmsTransactionManager"/>
>
>  </bean>
>
>  <bean id="jmsTransactionManager"
> class="org.springframework.jms.connection.JmsTransactionManager">
>    <property name="connectionFactory" ref="jndiConnectionFactory"/>
>  </bean>
>
>  <bean id="jmsTransactionPolicy"
> class="org.apache.camel.spring.spi.SpringTransactionPolicy">
>    <property name="propagationBehaviorName" value="PROPAGATION_REQUIRED"/>
>    <property name="transactionManager" ref="jmsTransactionManager"/>
>  </bean>
>
> <bean id="jndiConnectionFactory"
> class="org.springframework.jndi.JndiObjectFactoryBean">
>    <property name="jndiTemplate">
>      <ref bean="jndiTemplate"/>
>    </property>
>    <property name="jndiName">
>      <value>XXXX_CONNECTION_FACTORY</value>
>    </property>
>  </bean>
>
> <bean id="jndiTemplate"
>        class="org.springframework.jndi.JndiTemplate"
>        factory-bean="jndiTemplateFactory"
>        factory-method="createJndiTemplate"/>
>
> Thanks,
>
> Monica
> --
> View this message in context: http://www.nabble.com/Aggregator-strategy-and-killing-the-process-tp26034906p26034906.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message