The delay occurs before the next processor, eg in your case .to

It just delays, eg using 60000 will delay for 1 minute.

On Tue, Aug 25, 2009 at 9:08 AM, Charles Moulliard<cmoulli...@gmail.com> wrote:
> Quick question.
>
> When delayer or delay are used in route. Is it the process (defined after
> the delayer or delay) who will be processed every x seconds/minutes
> (depending on what has been defined) or the messages ?
>
> e.g.
>
> from(queue).delay(600000).to()
>
> Case A : processor is delayed every x seconds/minutes
>
> Route started at 8:00
> Message posted at 8:15, 8:40
> Messages will be processed at 9:00
>
> Case B : message are processed separately
>
> Route started at 8:00
> Message A : 8:15,
> Message B : 8:40
> Message A will be processed at 9:15
> Message B will be processed at 9:40
>
> Regards
>
> Charles Moulliard
> Senior Enterprise Architect
> Apache Camel Committer
>
> *****************************
> blog : http://cmoulliard.blogspot.com
>
>
> On Mon, Aug 24, 2009 at 5:29 PM, Claus Ibsen <claus.ib...@gmail.com> wrote:
>
>> :)
>>
>> A transaction also have a timeout, so you cannot expect that to work
>> as delayer = 2min will delay every single processing step with 2 min.
>> So to route to the end takes like 8 x 2 min.
>>
>> See about Delayer interceptor here:
>> http://camel.apache.org/delay-interceptor.html
>>
>> On Mon, Aug 24, 2009 at 4:48 PM, Charles Moulliard<cmoulli...@gmail.com>
>> wrote:
>> > Hi,
>> >
>> > If a transacted route use delayer, then the process stops (it seems that
>> the
>> > transaction is not committed ...  and that the message stays in the queue
>> )
>> > in the step generating the file.
>> >
>> > Here is the syntax of the route :
>> >
>> >        <camel:route errorHandlerRef="txErrorHandlerReqNew"
>> > delayer="120000">
>> >
>> >            <camel:from ref="queueReportingEndpoint"/>
>> >            <camel:transacted ref="PROPAGATION_REQUIRED_NEW" />
>> >            <camel:choice>
>> >                <camel:when>
>> >                    <camel:simple>${body} != null</camel:simple>
>> >                    <camel:doTry>
>> >                        <camel:marshal ref="csvAuditBindyDataFormat" />
>> >                        <camel:to ref="fileReportingEndpoint" /> // ROUTE
>> > STOPS HERE
>> >                        <camel:doCatch>
>> >
>> > <camel:exception>java.lang.Exception</camel:exception>
>> >                            <camel:to
>> >
>> uri="log:com.xpectis.x3s?level=INFO&amp;multiline=true&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true"
>> > />
>> >                            <camel:rollback />
>> >                        </camel:doCatch>
>> >                    </camel:doTry>
>> >                </camel:when>
>> >            </camel:choice>
>> >        </camel:route>
>> >
>> > Here is the stack trace of the route when the delayer is not used :
>> >
>> > 16:32:59,651 | INFO  | tenerContainer-1 | TraceInterceptor
>>   |
>> > rg.apache.camel.processor.Logger   88 |
>> > ID:dell-charles-1840-1251124287338-3:8:1:1:1 >>>
>> > from(queuingservice://x3s:reporting) --> ref:PROPAGATION_REQUIRED_NEW,
>> > Pattern:InOnly, Headers:{JMSXGroupID=null, JMSReplyTo=null,
>> > CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, JMSPriority=4,
>> > CamelBeanMultiParameterArray=false, CamelFileNameOnly=OINP_Example.csv,
>> > CamelFileLength=892, CamelFileAbsolute=true, JMSRedelivered=false,
>> > CamelFileParent=d:\temp\data\oinp, CamelFileLastModified=Mon Jul 27
>> 16:33:12
>> > CEST 2009, JMSTimestamp=1251124379479,
>> JMSDestination=queue://x3s:reporting,
>> > JMSExpiration=0, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv,
>> > CamelFileName=OINP_Example.csv, JMSDeliveryMode=2, JMSCorrelationID=null,
>> > JMSType=null, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv,
>> > origin=file, messageType=OINP,
>> > JMSMessageID=ID:dell-charles-1840-1251124287338-3:8:1:1:1},
>> > BodyType:java.util.ArrayList,
>> >
>> Body:[{com.xpectis.x3s.model.backoffice.audit.in.inaudit=com.xpectis.x3s.model.backoffice.audit.in.inau...@a0ee3f
>> > }]
>> > 16:32:59,651 | INFO  | tenerContainer-1 | TraceInterceptor
>>   |
>> > rg.apache.camel.processor.Logger   88 |
>> > ID:dell-charles-1840-1251124287338-3:8:1:1:1 >>>
>> > ref:PROPAGATION_REQUIRED_NEW --> Choice, Pattern:InOnly,
>> > Headers:{JMSXGroupID=null, JMSReplyTo=null,
>> > CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, JMSPriority=4,
>> > CamelBeanMultiParameterArray=false, CamelFileNameOnly=OINP_Example.csv,
>> > CamelFileLength=892, CamelFileAbsolute=true, JMSRedelivered=false,
>> > CamelFileParent=d:\temp\data\oinp, CamelFileLastModified=Mon Jul 27
>> 16:33:12
>> > CEST 2009, JMSTimestamp=1251124379479,
>> JMSDestination=queue://x3s:reporting,
>> > JMSExpiration=0, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv,
>> > CamelFileName=OINP_Example.csv, JMSDeliveryMode=2, JMSCorrelationID=null,
>> > JMSType=null, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv,
>> > origin=file, messageType=OINP,
>> > JMSMessageID=ID:dell-charles-1840-1251124287338-3:8:1:1:1},
>> > BodyType:java.util.ArrayList,
>> >
>> Body:[{com.xpectis.x3s.model.backoffice.audit.in.inaudit=com.xpectis.x3s.model.backoffice.audit.in.inau...@a0ee3f
>> > }]
>> > 16:32:59,682 | INFO  | tenerContainer-1 | TraceInterceptor
>>   |
>> > rg.apache.camel.processor.Logger   88 |
>> > ID:dell-charles-1840-1251124287338-3:8:1:1:1 >>> Choice --> Try,
>> > Pattern:InOnly, Headers:{JMSXGroupID=null, JMSReplyTo=null,
>> > CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, JMSPriority=4,
>> > CamelBeanMultiParameterArray=false, CamelFileNameOnly=OINP_Example.csv,
>> > CamelFileLength=892, CamelFileAbsolute=true, JMSRedelivered=false,
>> > CamelFileParent=d:\temp\data\oinp, CamelFileLastModified=Mon Jul 27
>> 16:33:12
>> > CEST 2009, JMSTimestamp=1251124379479,
>> JMSDestination=queue://x3s:reporting,
>> > JMSExpiration=0, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv,
>> > CamelFileName=OINP_Example.csv, JMSDeliveryMode=2, JMSCorrelationID=null,
>> > JMSType=null, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv,
>> > origin=file, messageType=OINP,
>> > JMSMessageID=ID:dell-charles-1840-1251124287338-3:8:1:1:1},
>> > BodyType:java.util.ArrayList,
>> >
>> Body:[{com.xpectis.x3s.model.backoffice.audit.in.inaudit=com.xpectis.x3s.model.backoffice.audit.in.inau...@a0ee3f
>> > }]
>> > 16:32:59,698 | INFO  | tenerContainer-1 | TraceInterceptor
>>   |
>> > rg.apache.camel.processor.Logger   88 |
>> > ID:dell-charles-1840-1251124287338-3:8:1:1:1 >>> Try -->, Pattern:InOnly,
>> > Headers:{JMSXGroupID=null, JMSReplyTo=null,
>> > CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv, JMSPriority=4,
>> > CamelBeanMultiParameterArray=false, CamelFileNameOnly=OINP_Example.csv,
>> > CamelFileLength=892, CamelFileAbsolute=true, JMSRedelivered=false,
>> > CamelFileParent=d:\temp\data\oinp, CamelFileLastModified=Mon Jul 27
>> 16:33:12
>> > CEST 2009, JMSTimestamp=1251124379479,
>> JMSDestination=queue://x3s:reporting,
>> > JMSExpiration=0, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv,
>> > CamelFileName=OINP_Example.csv, JMSDeliveryMode=2, JMSCorrelationID=null,
>> > JMSType=null, CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv,
>> > origin=file, messageType=OINP,
>> > JMSMessageID=ID:dell-charles-1840-1251124287338-3:8:1:1:1},
>> > BodyType:java.util.ArrayList,
>> >
>> Body:[{com.xpectis.x3s.model.backoffice.audit.in.inaudit=com.xpectis.x3s.model.backoffice.audit.in.inau...@a0ee3f
>> > }]
>> > 16:33:00,151 | INFO  | tenerContainer-1 | TraceInterceptor
>>   |
>> > rg.apache.camel.processor.Logger   88 |
>> > ID:dell-charles-1840-1251124287338-3:8:1:1:1 >>>  -->
>> >
>> file://d:/temp/data/reporting?fileName=%2F%24%7Bdate%3Anow%3AyyyyMMdd%7D%2F%24%7Bdate%3Anow%3Ahhmmss%7D.txt,
>> > Pattern:InOnly,
>> > Headers:{JMSMessageID=ID:dell-charles-1840-1251124287338-3:8:1:1:1,
>> > JMSReplyTo=null, CamelFileName=OINP_Example.csv,
>> JMSTimestamp=1251124379479,
>> > JMSCorrelationID=null, CamelFileParent=d:\temp\data\oinp, JMSPriority=4,
>> > CamelFileNameOnly=OINP_Example.csv, JMSDestination=queue://x3s:reporting,
>> > origin=file, JMSExpiration=0,
>> > CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv,
>> JMSDeliveryMode=2,
>> > CamelFileLength=892, CamelBeanMultiParameterArray=false,
>> > JMSRedelivered=false, JMSXGroupID=null, JMSType=null,
>> > CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv,
>> messageType=OINP,
>> > CamelFileAbsolute=true, CamelFilePath=d:\temp\data\oinp\OINP_Example.csv,
>> > CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009}, BodyType:byte[],
>> > Body:E9998,Unknown error,ERR,20093224-04:32:59,null,null,null
>> >
>> > But when DELAYER is enable in the route, the transaction is not commited
>> :
>> >
>> > 16:46:37,073 | INFO  | tenerContainer-1 | TraceInterceptor
>>   |
>> > rg.apache.camel.processor.Logger   88 |
>> > ID:dell-charles-1840-1251124287338-3:17:1:1:1 >>> Choice --> Try,
>> > Pattern:InOnly, Headers:{CamelFileNameOnly=OINP_Example.csv,
>> > JMSDestination=queue://x3s:reporting,
>> > CamelFileAbsolutePath=d:\temp\data\oinp\OINP_Example.csv,
>> > CamelFileName=OINP_Example.csv, origin=file, JMSPriority=4,
>> > JMSXGroupID=null, JMSReplyTo=null,
>> > CamelFileRelativePath=d:\temp\data\oinp\OINP_Example.csv,
>> > CamelBeanMultiParameterArray=false, JMSRedelivered=false,
>> JMSDeliveryMode=2,
>> > JMSMessageID=ID:dell-charles-1840-1251124287338-3:17:1:1:1,
>> > CamelFileParent=d:\temp\data\oinp, JMSType=null, JMSExpiration=0,
>> > CamelFileLength=892, CamelFileLastModified=Mon Jul 27 16:33:12 CEST 2009,
>> > CamelFileAbsolute=true, JMSCorrelationID=null, messageType=OINP,
>> > CamelFilePath=d:\temp\data\oinp\OINP_Example.csv,
>> > JMSTimestamp=1251124681885}, BodyType:java.util.ArrayList,
>> >
>> Body:[{com.xpectis.x3s.model.backoffice.audit.in.inaudit=com.xpectis.x3s.model.backoffice.audit.in.inau...@13e6f3
>> > }]
>> >
>> > Every 2 minutes, the delayer tries to reprocess the message without
>> success
>> >
>> > Regards,
>> >
>> >
>> > Charles Moulliard
>> > Senior Enterprise Architect
>> > Apache Camel Committer
>> >
>> > *****************************
>> > blog : http://cmoulliard.blogspot.com
>> >
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to