camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MARTINEZ Jaime <jmartinez.predellservi...@gmail.com>
Subject Problem with onCompletion mode="BeforeConsumer"
Date Wed, 18 Feb 2015 16:33:14 GMT
Hi

Sorry for my english, i'll make my best effort for write this.

I hava a xml file like this:

<routes xmlns="http://camel.apache.org/schema/spring">

    <route id="id1">
        <from uri="timer://foo?fixedRate=true&amp;period=60s"/>
        <onCompletion mode="BeforeConsumer">
            <log message="finish"/>
        </onCompletion>
        <setBody>
            <simple>Probando 1</simple>
        </setBody>
       <log message="working1"/>
        <to uri="direct:test1"/>
    </route>

    <route id="id2">
        <from uri="direct:test1"/>
        <setBody>
            <simple>Test2</simple>
        </setBody>
        <log message="working2"/>
        <to uri="direct:test2"/>
    </route>

    <route id="id3">
        <from uri="direct:test2"/>
        <setBody>
            <simple>Test3</simple>
        </setBody>
        <log message="working3"/>
   </route>
</routes>

if remove mode="BeforeConsumer" from the first route i get one
"finish" in the log, but if i use the xml with mode="BeforeConsumer" i
get the message 3 times (one per each route). Is that the behavior
expected?

I need that the onCompletion code runs one time but i need too the
mode="BeforeConsumer"

Thanks for your time

Mime
View raw message