You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Charles Moulliard <cm...@gmail.com> on 2009/08/21 09:36:21 UTC

Camel & Quartz

Hi,

I have configured my route to use quartz as a job scheduler to read the
content of my queue every 5 minutes but unfortunately, the body type send to
marshal endpoint is of type "JobDetail" and not "List" as expected.

09:30:02,545 | INFO  | heduler_Worker-1 | x3s                              |
rg.apache.camel.processor.Logger   88 | Exchange[
, BodyType:org.quartz.JobDetail
, Body:JobDetail
'DEFAULT.quartz://x3sReporting/clientError?cron=0+0%2F5+9-18+%3F+*+MON-FRI':
jobClass: 'org.apache.camel.component.quartz.CamelJob isStateful: false
isVolatile: false isDurable: false requestsRecovers: false
, CaughtExceptionType:java.lang.ClassCastException,
CaughtExceptionMessage:org.quartz.JobDetail,
StackTrace:java.lang.ClassCastException: org.quartz.JobDetail
    at
org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.marshal(BindyCsvDataFormat.java:60)
    at
org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:52)

Is my configuration wrong ?

        <camel:route errorHandlerRef="txErrorHandler">
            <camel:from
uri="quartz://x3sReporting/clientError?cron=0+0/5+9-18+?+*+MON-FRI"/>
            <camel:to ref="queueReportingEndpoint" />
            <camel:transacted ref="PROPAGATION_REQUIRED" />
            <camel:doTry>
                <camel:filter>
                    <camel:simple>body is java.util.List</camel:simple>
                </camel:filter>
                <camel:marshal ref="csvAuditBindyDataFormat" />
                <camel:to ref="fileReportingEndpoint" />
                <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:route>

Regards,

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com

Re: Camel & Quartz

Posted by Charles Moulliard <cm...@gmail.com>.
So I will try to use a delayer between the queue and the reporting service :

           <camel:from ref="queueReportingEndpoint" />
           <camel:transacted ref="PROPAGATION_REQUIRED" />
           <camel:delay><constant>3600000</constant></camel:delay> --> to
delay 1H

BTW : It should be interesting to link (like in a job) the starting/stopping
of a Camel route to a scheduler and to offer the possibity to link routes
together depending if the job succeed (= route) or fail. With such feature,
we can use also Camel as Spring Barch to handle jobs !!!!

Regards,

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com


On Fri, Aug 21, 2009 at 10:50 AM, Willem Jiang <wi...@gmail.com>wrote:

> Hi Charles,
>
> I don't think the route rule will work for you.
> Please remember if your rule has the
> <camel:to ref="queueReportingEndpoint" />
> will send the message body to your report queue, not receive the message
> for the report queue.
>
> Maybe you need find other way to trigge the jms consumer.
>
> Willem
>
>
> Charles Moulliard wrote:
>
>> Hi,
>>
>> I have configured my route to use quartz as a job scheduler to read the
>> content of my queue every 5 minutes but unfortunately, the body type send
>> to
>> marshal endpoint is of type "JobDetail" and not "List" as expected.
>>
>> 09:30:02,545 | INFO  | heduler_Worker-1 | x3s
>>  |
>> rg.apache.camel.processor.Logger   88 | Exchange[
>> , BodyType:org.quartz.JobDetail
>> , Body:JobDetail
>>
>> 'DEFAULT.quartz://x3sReporting/clientError?cron=0+0%2F5+9-18+%3F+*+MON-FRI':
>> jobClass: 'org.apache.camel.component.quartz.CamelJob isStateful: false
>> isVolatile: false isDurable: false requestsRecovers: false
>> , CaughtExceptionType:java.lang.ClassCastException,
>> CaughtExceptionMessage:org.quartz.JobDetail,
>> StackTrace:java.lang.ClassCastException: org.quartz.JobDetail
>>    at
>>
>> org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.marshal(BindyCsvDataFormat.java:60)
>>    at
>>
>> org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:52)
>>
>> Is my configuration wrong ?
>>
>>        <camel:route errorHandlerRef="txErrorHandler">
>>            <camel:from
>> uri="quartz://x3sReporting/clientError?cron=0+0/5+9-18+?+*+MON-FRI"/>
>>            <camel:to ref="queueReportingEndpoint" />
>>            <camel:transacted ref="PROPAGATION_REQUIRED" />
>>            <camel:doTry>
>>                <camel:filter>
>>                    <camel:simple>body is java.util.List</camel:simple>
>>                </camel:filter>
>>                <camel:marshal ref="csvAuditBindyDataFormat" />
>>                <camel:to ref="fileReportingEndpoint" />
>>                <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:route>
>>
>> Regards,
>>
>> Charles Moulliard
>> Senior Enterprise Architect
>> Apache Camel Committer
>>
>> *****************************
>> blog : http://cmoulliard.blogspot.com
>>
>>
>

Re: Camel & Quartz

Posted by Charles Moulliard <cm...@gmail.com>.
I have also created the following route + aggregator

        <camel:route errorHandlerRef="txErrorHandler">
            <camel:from
uri="quartz://x3sReporting/clientError?cron=0+0/5+9-18+?+*+MON-FRI"/>
            <camel:pollEnrich uri="queuingservice:x3s:reporting"
strategyRef="queueAggregator"/>
            <camel:transacted ref="PROPAGATION_REQUIRED" />
            <camel:doTry>
                <camel:marshal ref="csvAuditBindyDataFormat" />
                <camel:to ref="fileReportingEndpoint" />
                <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:route>

    <bean id="queueAggregator"
class="com.xpectis.x3s.core.util.QueueAggregator"/>

but error :

13:10:02,013 | INFO  | heduler_Worker-1 | TraceInterceptor                 |
rg.apache.camel.processor.Logger   88 |
ID-dell-charles-1326-1250837959638-0-92 >>>
from(quartz://x3sReporting/clientError?cron=0+0%2F5+9-18+%3F+*+MON-FRI) -->
ref:PROPAGATION_REQUIRED, Pattern:InOnly, Headers:{previousFireTime=null,
nextFireTime=Fri Aug 21 13:15:00 CEST 2009,
scheduler=org.quartz.impl.StdScheduler@785ad7, triggerGroup=x3sReporting,
trigger=Trigger 'x3sReporting.clientError':  triggerClass:
'org.quartz.CronTrigger isVolatile: false calendar: 'null'
misfireInstruction: 0 nextFireTime: Fri Aug 21 13:15:00 CEST 2009,
mergedJobDataMap=org.quartz.JobDataMap@ccc462dc, scheduledFireTime=Fri Aug
21 13:10:00 CEST 2009, fireTime=Fri Aug 21 13:10:00 CEST 2009,
jobDetail=JobDetail
'DEFAULT.quartz://x3sReporting/clientError?cron=0+0%2F5+9-18+%3F+*+MON-FRI':
jobClass: 'org.apache.camel.component.quartz.CamelJob isStateful: false
isVolatile: false isDurable: false requestsRecovers: false, calendar=null,
jobInstance=org.apache.camel.component.quartz.CamelJob@1940ed6, result=null,
jobRunTime=-1, triggerName=clientError, refireCount=0},
BodyType:org.quartz.JobDetail, Body:JobDetail
'DEFAULT.quartz://x3sReporting/clientError?cron=0+0%2F5+9-18+%3F+*+MON-FRI':
jobClass: 'org.apache.camel.component.quartz.CamelJob isStateful: false
isVolatile: false isDurable: false requestsRecovers: false
13:10:02,013 | INFO  | heduler_Worker-1 | TraceInterceptor                 |
rg.apache.camel.processor.Logger   88 |
ID-dell-charles-1326-1250837959638-0-92 >>> ref:PROPAGATION_REQUIRED -->
Try, Pattern:InOnly, Headers:{previousFireTime=null, nextFireTime=Fri Aug 21
13:15:00 CEST 2009, scheduler=org.quartz.impl.StdScheduler@785ad7,
triggerGroup=x3sReporting, trigger=Trigger 'x3sReporting.clientError':
triggerClass: 'org.quartz.CronTrigger isVolatile: false calendar: 'null'
misfireInstruction: 0 nextFireTime: Fri Aug 21 13:15:00 CEST 2009,
mergedJobDataMap=org.quartz.JobDataMap@ccc462dc, scheduledFireTime=Fri Aug
21 13:10:00 CEST 2009, fireTime=Fri Aug 21 13:10:00 CEST 2009,
jobDetail=JobDetail
'DEFAULT.quartz://x3sReporting/clientError?cron=0+0%2F5+9-18+%3F+*+MON-FRI':
jobClass: 'org.apache.camel.component.quartz.CamelJob isStateful: false
isVolatile: false isDurable: false requestsRecovers: false, calendar=null,
jobInstance=org.apache.camel.component.quartz.CamelJob@1940ed6, result=null,
jobRunTime=-1, triggerName=clientError, refireCount=0},
BodyType:org.quartz.JobDetail, Body:JobDetail
'DEFAULT.quartz://x3sReporting/clientError?cron=0+0%2F5+9-18+%3F+*+MON-FRI':
jobClass: 'org.apache.camel.component.quartz.CamelJob isStateful: false
isVolatile: false isDurable: false requestsRecovers: false
13:10:02,029 | INFO  | heduler_Worker-1 | TraceInterceptor                 |
rg.apache.camel.processor.Logger   88 |
ID-dell-charles-1326-1250837959638-0-92 >>> Try -->, Pattern:InOnly,
Headers:{previousFireTime=null, nextFireTime=Fri Aug 21 13:15:00 CEST 2009,
scheduler=org.quartz.impl.StdScheduler@785ad7, triggerGroup=x3sReporting,
trigger=Trigger 'x3sReporting.clientError':  triggerClass:
'org.quartz.CronTrigger isVolatile: false calendar: 'null'
misfireInstruction: 0 nextFireTime: Fri Aug 21 13:15:00 CEST 2009,
mergedJobDataMap=org.quartz.JobDataMap@ccc462dc, scheduledFireTime=Fri Aug
21 13:10:00 CEST 2009, fireTime=Fri Aug 21 13:10:00 CEST 2009,
jobDetail=JobDetail
'DEFAULT.quartz://x3sReporting/clientError?cron=0+0%2F5+9-18+%3F+*+MON-FRI':
jobClass: 'org.apache.camel.component.quartz.CamelJob isStateful: false
isVolatile: false isDurable: false requestsRecovers: false, calendar=null,
jobInstance=org.apache.camel.component.quartz.CamelJob@1940ed6, result=null,
jobRunTime=-1, triggerName=clientError, refireCount=0},
BodyType:org.quartz.JobDetail, Body:JobDetail
'DEFAULT.quartz://x3sReporting/clientError?cron=0+0%2F5+9-18+%3F+*+MON-FRI':
jobClass: 'org.apache.camel.component.quartz.CamelJob isStateful: false
isVolatile: false isDurable: false requestsRecovers: false
13:10:02,435 | INFO  | heduler_Worker-1 | TraceInterceptor                 |
rg.apache.camel.processor.Logger  166 |
ID-dell-charles-1326-1250837959638-0-92 >>> Try -->, Pattern:InOnly,
Headers:{previousFireTime=null, nextFireTime=Fri Aug 21 13:15:00 CEST 2009,
scheduler=org.quartz.impl.StdScheduler@785ad7, triggerGroup=x3sReporting,
trigger=Trigger 'x3sReporting.clientError':  triggerClass:
'org.quartz.CronTrigger isVolatile: false calendar: 'null'
misfireInstruction: 0 nextFireTime: Fri Aug 21 13:15:00 CEST 2009,
mergedJobDataMap=org.quartz.JobDataMap@ccc462dc, scheduledFireTime=Fri Aug
21 13:10:00 CEST 2009, fireTime=Fri Aug 21 13:10:00 CEST 2009,
jobDetail=JobDetail
'DEFAULT.quartz://x3sReporting/clientError?cron=0+0%2F5+9-18+%3F+*+MON-FRI':
jobClass: 'org.apache.camel.component.quartz.CamelJob isStateful: false
isVolatile: false isDurable: false requestsRecovers: false, calendar=null,
jobInstance=org.apache.camel.component.quartz.CamelJob@1940ed6, result=null,
jobRunTime=-1, triggerName=clientError, refireCount=0},
BodyType:org.quartz.JobDetail, Body:JobDetail
'DEFAULT.quartz://x3sReporting/clientError?cron=0+0%2F5+9-18+%3F+*+MON-FRI':
jobClass: 'org.apache.camel.component.quartz.CamelJob isStateful: false
isVolatile: false isDurable: false requestsRecovers: false, Exception:
java.lang.ClassCastException: org.quartz.JobDetail
13:10:02,435 | INFO  | heduler_Worker-1 | TraceInterceptor                 |
rg.apache.camel.processor.Logger   88 |
ID-dell-charles-1326-1250837959638-0-93 >>>  -->
log://com.xpectis.x3s?level=INFO&multiline=true&showCaughtException=true&showException=true&showStackTrace=true,
Pattern:InOnly, Headers:{nextFireTime=Fri Aug 21 13:15:00 CEST 2009,
jobDetail=JobDetail
'DEFAULT.quartz://x3sReporting/clientError?cron=0+0%2F5+9-18+%3F+*+MON-FRI':
jobClass: 'org.apache.camel.component.quartz.CamelJob isStateful: false
isVolatile: false isDurable: false requestsRecovers: false, refireCount=0,
result=null, triggerGroup=x3sReporting,
scheduler=org.quartz.impl.StdScheduler@785ad7, jobRunTime=-1,
triggerName=clientError, fireTime=Fri Aug 21 13:10:00 CEST 2009,
trigger=Trigger 'x3sReporting.clientError':  triggerClass:
'org.quartz.CronTrigger isVolatile: false calendar: 'null'
misfireInstruction: 0 nextFireTime: Fri Aug 21 13:15:00 CEST 2009,
previousFireTime=null, calendar=null, scheduledFireTime=Fri Aug 21 13:10:00
CEST 2009, mergedJobDataMap=org.quartz.JobDataMap@ccc462dc,
jobInstance=org.apache.camel.component.quartz.CamelJob@1940ed6},
BodyType:org.quartz.JobDetail, Body:JobDetail
'DEFAULT.quartz://x3sReporting/clientError?cron=0+0%2F5+9-18+%3F+*+MON-FRI':
jobClass: 'org.apache.camel.component.quartz.CamelJob isStateful: false
isVolatile: false isDurable: false requestsRecovers: false
13:10:02,435 | INFO  | heduler_Worker-1 | x3s                              |
rg.apache.camel.processor.Logger   88 | Exchange[
, BodyType:org.quartz.JobDetail
, Body:JobDetail
'DEFAULT.quartz://x3sReporting/clientError?cron=0+0%2F5+9-18+%3F+*+MON-FRI':
jobClass: 'org.apache.camel.component.quartz.CamelJob isStateful: false
isVolatile: false isDurable: false requestsRecovers: false
, CaughtExceptionType:java.lang.ClassCastException,
CaughtExceptionMessage:org.quartz.JobDetail,
StackTrace:java.lang.ClassCastException: org.quartz.JobDetail


Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com


On Fri, Aug 21, 2009 at 12:39 PM, Charles Moulliard <cm...@gmail.com>wrote:

> I have tried this :
>
>         <camel:route errorHandlerRef="txErrorHandler">
>             <camel:from
> uri="quartz://x3sReporting/clientError?cron=0+0/5+9-18+?+*+MON-FRI"/>
>             <camel:pollEnrich uri="queuingservice:x3s:reporting"/>
>             <camel:transacted ref="PROPAGATION_REQUIRED" />
>             <camel:marshal ref="csvAuditBindyDataFormat" />
>             <camel:to ref="fileReportingEndpoint" />
>
> but the error is still there :
>
> 12:35:02,451 | INFO  | heduler_Worker-1 | x3s
> | rg.apache.camel.processor.Logger   88 | Exchange[
> , BodyType:org.quartz.JobDetail
> , Body:JobDetail
> 'DEFAULT.quartz://x3sReporting/clientError?cron=0+0%2F5+9-18+%3F+*+MON-FRI':
> jobClass: 'org.apache.camel.component.quartz.CamelJob isStateful: false
> isVolatile: false isDurable: false requestsRecovers: false
> , CaughtExceptionType:java.lang.ClassCastException,
> CaughtExceptionMessage:org.quartz.JobDetail,
> StackTrace:java.lang.ClassCastException: org.quartz.JobDetail
>     at
> org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.marshal(BindyCsvDataFormat.java:60)
>
> Charles Moulliard
> Senior Enterprise Architect
> Apache Camel Committer
>
> *****************************
> blog : http://cmoulliard.blogspot.com
>
>
> On Fri, Aug 21, 2009 at 12:25 PM, Charles Moulliard <cm...@gmail.com>wrote:
>
>> Claus,
>>
>> You mean to create a route like this :
>>
>> A) Option 1
>>
>>    <camel:from
>> uri="quartz://x3sReporting/clientError?cron=0+0/5+9-18+?+*+MON-FRI"/>
>>       <camel:to ref="queueReportingEndpoint" />
>>       <camel:pollEnrich uri="????"/>
>>       <camel:marshal ref="csvAuditBindyDataFormat" />
>>       <camel:to ref="fileReportingEndpoint" />
>>
>> Question :
>> - In my case, no enrichement is planned so which information must be put
>> to replace ????
>> - How can we define the delay in spring DSL ?
>>
>> OR
>>
>> B) Option 2
>>
>> <from ref="queueReportingEndpoint" />
>>       <camel:pollEnrich uri="????"/>
>>
>> Remark : In spring DSL, pollEnrich only accepts an uri but not a ref !!
>>
>> Is this approach better than using delayer EIP ?
>>
>>
>> Charles Moulliard
>> Senior Enterprise Architect
>> Apache Camel Committer
>>
>> *****************************
>> blog : http://cmoulliard.blogspot.com
>>
>>
>> On Fri, Aug 21, 2009 at 10:57 AM, Claus Ibsen <cl...@gmail.com>wrote:
>>
>>> On Fri, Aug 21, 2009 at 10:50 AM, Willem Jiang<wi...@gmail.com>
>>> wrote:
>>> > Hi Charles,
>>> >
>>> > I don't think the route rule will work for you.
>>> > Please remember if your rule has the
>>> > <camel:to ref="queueReportingEndpoint" />
>>> > will send the message body to your report queue, not receive the
>>> message for
>>> > the report queue.
>>> >
>>> > Maybe you need find other way to trigge the jms consumer.
>>> >
>>>
>>> .pollEnrich can consume for a endpoint.
>>>
>>>
>>> > Willem
>>> >
>>> > Charles Moulliard wrote:
>>> >>
>>> >> Hi,
>>> >>
>>> >> I have configured my route to use quartz as a job scheduler to read
>>> the
>>> >> content of my queue every 5 minutes but unfortunately, the body type
>>> send
>>> >> to
>>> >> marshal endpoint is of type "JobDetail" and not "List" as expected.
>>> >>
>>> >> 09:30:02,545 | INFO  | heduler_Worker-1 | x3s
>>> >>  |
>>> >> rg.apache.camel.processor.Logger   88 | Exchange[
>>> >> , BodyType:org.quartz.JobDetail
>>> >> , Body:JobDetail
>>> >>
>>> >>
>>> 'DEFAULT.quartz://x3sReporting/clientError?cron=0+0%2F5+9-18+%3F+*+MON-FRI':
>>> >> jobClass: 'org.apache.camel.component.quartz.CamelJob isStateful:
>>> false
>>> >> isVolatile: false isDurable: false requestsRecovers: false
>>> >> , CaughtExceptionType:java.lang.ClassCastException,
>>> >> CaughtExceptionMessage:org.quartz.JobDetail,
>>> >> StackTrace:java.lang.ClassCastException: org.quartz.JobDetail
>>> >>    at
>>> >>
>>> >>
>>> org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.marshal(BindyCsvDataFormat.java:60)
>>> >>    at
>>> >>
>>> >>
>>> org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:52)
>>> >>
>>> >> Is my configuration wrong ?
>>> >>
>>> >>        <camel:route errorHandlerRef="txErrorHandler">
>>> >>            <camel:from
>>> >> uri="quartz://x3sReporting/clientError?cron=0+0/5+9-18+?+*+MON-FRI"/>
>>> >>            <camel:to ref="queueReportingEndpoint" />
>>> >>            <camel:transacted ref="PROPAGATION_REQUIRED" />
>>> >>            <camel:doTry>
>>> >>                <camel:filter>
>>> >>                    <camel:simple>body is java.util.List</camel:simple>
>>> >>                </camel:filter>
>>> >>                <camel:marshal ref="csvAuditBindyDataFormat" />
>>> >>                <camel:to ref="fileReportingEndpoint" />
>>> >>                <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:route>
>>> >>
>>> >> 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
>>>
>>
>>
>

Re: Camel & Quartz

Posted by Charles Moulliard <cm...@gmail.com>.
I have tried this :

        <camel:route errorHandlerRef="txErrorHandler">
            <camel:from
uri="quartz://x3sReporting/clientError?cron=0+0/5+9-18+?+*+MON-FRI"/>
            <camel:pollEnrich uri="queuingservice:x3s:reporting"/>
            <camel:transacted ref="PROPAGATION_REQUIRED" />
            <camel:marshal ref="csvAuditBindyDataFormat" />
            <camel:to ref="fileReportingEndpoint" />

but the error is still there :

12:35:02,451 | INFO  | heduler_Worker-1 | x3s                              |
rg.apache.camel.processor.Logger   88 | Exchange[
, BodyType:org.quartz.JobDetail
, Body:JobDetail
'DEFAULT.quartz://x3sReporting/clientError?cron=0+0%2F5+9-18+%3F+*+MON-FRI':
jobClass: 'org.apache.camel.component.quartz.CamelJob isStateful: false
isVolatile: false isDurable: false requestsRecovers: false
, CaughtExceptionType:java.lang.ClassCastException,
CaughtExceptionMessage:org.quartz.JobDetail,
StackTrace:java.lang.ClassCastException: org.quartz.JobDetail
    at
org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.marshal(BindyCsvDataFormat.java:60)

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com


On Fri, Aug 21, 2009 at 12:25 PM, Charles Moulliard <cm...@gmail.com>wrote:

> Claus,
>
> You mean to create a route like this :
>
> A) Option 1
>
>    <camel:from
> uri="quartz://x3sReporting/clientError?cron=0+0/5+9-18+?+*+MON-FRI"/>
>       <camel:to ref="queueReportingEndpoint" />
>       <camel:pollEnrich uri="????"/>
>       <camel:marshal ref="csvAuditBindyDataFormat" />
>       <camel:to ref="fileReportingEndpoint" />
>
> Question :
> - In my case, no enrichement is planned so which information must be put to
> replace ????
> - How can we define the delay in spring DSL ?
>
> OR
>
> B) Option 2
>
> <from ref="queueReportingEndpoint" />
>       <camel:pollEnrich uri="????"/>
>
> Remark : In spring DSL, pollEnrich only accepts an uri but not a ref !!
>
> Is this approach better than using delayer EIP ?
>
>
> Charles Moulliard
> Senior Enterprise Architect
> Apache Camel Committer
>
> *****************************
> blog : http://cmoulliard.blogspot.com
>
>
> On Fri, Aug 21, 2009 at 10:57 AM, Claus Ibsen <cl...@gmail.com>wrote:
>
>> On Fri, Aug 21, 2009 at 10:50 AM, Willem Jiang<wi...@gmail.com>
>> wrote:
>> > Hi Charles,
>> >
>> > I don't think the route rule will work for you.
>> > Please remember if your rule has the
>> > <camel:to ref="queueReportingEndpoint" />
>> > will send the message body to your report queue, not receive the message
>> for
>> > the report queue.
>> >
>> > Maybe you need find other way to trigge the jms consumer.
>> >
>>
>> .pollEnrich can consume for a endpoint.
>>
>>
>> > Willem
>> >
>> > Charles Moulliard wrote:
>> >>
>> >> Hi,
>> >>
>> >> I have configured my route to use quartz as a job scheduler to read the
>> >> content of my queue every 5 minutes but unfortunately, the body type
>> send
>> >> to
>> >> marshal endpoint is of type "JobDetail" and not "List" as expected.
>> >>
>> >> 09:30:02,545 | INFO  | heduler_Worker-1 | x3s
>> >>  |
>> >> rg.apache.camel.processor.Logger   88 | Exchange[
>> >> , BodyType:org.quartz.JobDetail
>> >> , Body:JobDetail
>> >>
>> >>
>> 'DEFAULT.quartz://x3sReporting/clientError?cron=0+0%2F5+9-18+%3F+*+MON-FRI':
>> >> jobClass: 'org.apache.camel.component.quartz.CamelJob isStateful: false
>> >> isVolatile: false isDurable: false requestsRecovers: false
>> >> , CaughtExceptionType:java.lang.ClassCastException,
>> >> CaughtExceptionMessage:org.quartz.JobDetail,
>> >> StackTrace:java.lang.ClassCastException: org.quartz.JobDetail
>> >>    at
>> >>
>> >>
>> org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.marshal(BindyCsvDataFormat.java:60)
>> >>    at
>> >>
>> >>
>> org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:52)
>> >>
>> >> Is my configuration wrong ?
>> >>
>> >>        <camel:route errorHandlerRef="txErrorHandler">
>> >>            <camel:from
>> >> uri="quartz://x3sReporting/clientError?cron=0+0/5+9-18+?+*+MON-FRI"/>
>> >>            <camel:to ref="queueReportingEndpoint" />
>> >>            <camel:transacted ref="PROPAGATION_REQUIRED" />
>> >>            <camel:doTry>
>> >>                <camel:filter>
>> >>                    <camel:simple>body is java.util.List</camel:simple>
>> >>                </camel:filter>
>> >>                <camel:marshal ref="csvAuditBindyDataFormat" />
>> >>                <camel:to ref="fileReportingEndpoint" />
>> >>                <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:route>
>> >>
>> >> 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
>>
>
>

Re: Camel & Quartz

Posted by Charles Moulliard <cm...@gmail.com>.
Claus,

You mean to create a route like this :

A) Option 1

   <camel:from
uri="quartz://x3sReporting/clientError?cron=0+0/5+9-18+?+*+MON-FRI"/>
      <camel:to ref="queueReportingEndpoint" />
      <camel:pollEnrich uri="????"/>
      <camel:marshal ref="csvAuditBindyDataFormat" />
      <camel:to ref="fileReportingEndpoint" />

Question :
- In my case, no enrichement is planned so which information must be put to
replace ????
- How can we define the delay in spring DSL ?

OR

B) Option 2

<from ref="queueReportingEndpoint" />
      <camel:pollEnrich uri="????"/>

Remark : In spring DSL, pollEnrich only accepts an uri but not a ref !!

Is this approach better than using delayer EIP ?


Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com


On Fri, Aug 21, 2009 at 10:57 AM, Claus Ibsen <cl...@gmail.com> wrote:

> On Fri, Aug 21, 2009 at 10:50 AM, Willem Jiang<wi...@gmail.com>
> wrote:
> > Hi Charles,
> >
> > I don't think the route rule will work for you.
> > Please remember if your rule has the
> > <camel:to ref="queueReportingEndpoint" />
> > will send the message body to your report queue, not receive the message
> for
> > the report queue.
> >
> > Maybe you need find other way to trigge the jms consumer.
> >
>
> .pollEnrich can consume for a endpoint.
>
>
> > Willem
> >
> > Charles Moulliard wrote:
> >>
> >> Hi,
> >>
> >> I have configured my route to use quartz as a job scheduler to read the
> >> content of my queue every 5 minutes but unfortunately, the body type
> send
> >> to
> >> marshal endpoint is of type "JobDetail" and not "List" as expected.
> >>
> >> 09:30:02,545 | INFO  | heduler_Worker-1 | x3s
> >>  |
> >> rg.apache.camel.processor.Logger   88 | Exchange[
> >> , BodyType:org.quartz.JobDetail
> >> , Body:JobDetail
> >>
> >>
> 'DEFAULT.quartz://x3sReporting/clientError?cron=0+0%2F5+9-18+%3F+*+MON-FRI':
> >> jobClass: 'org.apache.camel.component.quartz.CamelJob isStateful: false
> >> isVolatile: false isDurable: false requestsRecovers: false
> >> , CaughtExceptionType:java.lang.ClassCastException,
> >> CaughtExceptionMessage:org.quartz.JobDetail,
> >> StackTrace:java.lang.ClassCastException: org.quartz.JobDetail
> >>    at
> >>
> >>
> org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.marshal(BindyCsvDataFormat.java:60)
> >>    at
> >>
> >>
> org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:52)
> >>
> >> Is my configuration wrong ?
> >>
> >>        <camel:route errorHandlerRef="txErrorHandler">
> >>            <camel:from
> >> uri="quartz://x3sReporting/clientError?cron=0+0/5+9-18+?+*+MON-FRI"/>
> >>            <camel:to ref="queueReportingEndpoint" />
> >>            <camel:transacted ref="PROPAGATION_REQUIRED" />
> >>            <camel:doTry>
> >>                <camel:filter>
> >>                    <camel:simple>body is java.util.List</camel:simple>
> >>                </camel:filter>
> >>                <camel:marshal ref="csvAuditBindyDataFormat" />
> >>                <camel:to ref="fileReportingEndpoint" />
> >>                <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:route>
> >>
> >> 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
>

Re: Camel & Quartz

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Aug 21, 2009 at 10:50 AM, Willem Jiang<wi...@gmail.com> wrote:
> Hi Charles,
>
> I don't think the route rule will work for you.
> Please remember if your rule has the
> <camel:to ref="queueReportingEndpoint" />
> will send the message body to your report queue, not receive the message for
> the report queue.
>
> Maybe you need find other way to trigge the jms consumer.
>

.pollEnrich can consume for a endpoint.


> Willem
>
> Charles Moulliard wrote:
>>
>> Hi,
>>
>> I have configured my route to use quartz as a job scheduler to read the
>> content of my queue every 5 minutes but unfortunately, the body type send
>> to
>> marshal endpoint is of type "JobDetail" and not "List" as expected.
>>
>> 09:30:02,545 | INFO  | heduler_Worker-1 | x3s
>>  |
>> rg.apache.camel.processor.Logger   88 | Exchange[
>> , BodyType:org.quartz.JobDetail
>> , Body:JobDetail
>>
>> 'DEFAULT.quartz://x3sReporting/clientError?cron=0+0%2F5+9-18+%3F+*+MON-FRI':
>> jobClass: 'org.apache.camel.component.quartz.CamelJob isStateful: false
>> isVolatile: false isDurable: false requestsRecovers: false
>> , CaughtExceptionType:java.lang.ClassCastException,
>> CaughtExceptionMessage:org.quartz.JobDetail,
>> StackTrace:java.lang.ClassCastException: org.quartz.JobDetail
>>    at
>>
>> org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.marshal(BindyCsvDataFormat.java:60)
>>    at
>>
>> org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:52)
>>
>> Is my configuration wrong ?
>>
>>        <camel:route errorHandlerRef="txErrorHandler">
>>            <camel:from
>> uri="quartz://x3sReporting/clientError?cron=0+0/5+9-18+?+*+MON-FRI"/>
>>            <camel:to ref="queueReportingEndpoint" />
>>            <camel:transacted ref="PROPAGATION_REQUIRED" />
>>            <camel:doTry>
>>                <camel:filter>
>>                    <camel:simple>body is java.util.List</camel:simple>
>>                </camel:filter>
>>                <camel:marshal ref="csvAuditBindyDataFormat" />
>>                <camel:to ref="fileReportingEndpoint" />
>>                <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:route>
>>
>> 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

Re: Camel & Quartz

Posted by Willem Jiang <wi...@gmail.com>.
Hi Charles,

I don't think the route rule will work for you.
Please remember if your rule has the
<camel:to ref="queueReportingEndpoint" />
will send the message body to your report queue, not receive the message 
for the report queue.

Maybe you need find other way to trigge the jms consumer.

Willem

Charles Moulliard wrote:
> Hi,
> 
> I have configured my route to use quartz as a job scheduler to read the
> content of my queue every 5 minutes but unfortunately, the body type send to
> marshal endpoint is of type "JobDetail" and not "List" as expected.
> 
> 09:30:02,545 | INFO  | heduler_Worker-1 | x3s                              |
> rg.apache.camel.processor.Logger   88 | Exchange[
> , BodyType:org.quartz.JobDetail
> , Body:JobDetail
> 'DEFAULT.quartz://x3sReporting/clientError?cron=0+0%2F5+9-18+%3F+*+MON-FRI':
> jobClass: 'org.apache.camel.component.quartz.CamelJob isStateful: false
> isVolatile: false isDurable: false requestsRecovers: false
> , CaughtExceptionType:java.lang.ClassCastException,
> CaughtExceptionMessage:org.quartz.JobDetail,
> StackTrace:java.lang.ClassCastException: org.quartz.JobDetail
>     at
> org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.marshal(BindyCsvDataFormat.java:60)
>     at
> org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:52)
> 
> Is my configuration wrong ?
> 
>         <camel:route errorHandlerRef="txErrorHandler">
>             <camel:from
> uri="quartz://x3sReporting/clientError?cron=0+0/5+9-18+?+*+MON-FRI"/>
>             <camel:to ref="queueReportingEndpoint" />
>             <camel:transacted ref="PROPAGATION_REQUIRED" />
>             <camel:doTry>
>                 <camel:filter>
>                     <camel:simple>body is java.util.List</camel:simple>
>                 </camel:filter>
>                 <camel:marshal ref="csvAuditBindyDataFormat" />
>                 <camel:to ref="fileReportingEndpoint" />
>                 <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:route>
> 
> Regards,
> 
> Charles Moulliard
> Senior Enterprise Architect
> Apache Camel Committer
> 
> *****************************
> blog : http://cmoulliard.blogspot.com
>