You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Hude <fl...@googlemail.com> on 2012/12/07 10:34:17 UTC
Camel QuartzComponent failed on recreating endpoint
We're using the camel quartz component (camel version 2.9.0 and quartz in
version 1.8.5) to trigger some jobs once a day. The routes are looking
similar to this:
from("quartz://aendHistNaechtlicherLauf?cron=0+0+23+*+*+?+*")
.routeId(aendHistNaechtlicherLauf)
.to("bean:aBean?method=aMethod(${header.fireTime})");
BTW: We have only one camel-context.
The problem is: On the first day when the application was started the routes
are running perfect, but on the next day we are getting this exception:
ERROR | 2012-12-05 23:00:00,003 | |
| DefaultQuartzScheduler-camelContext_Worker-6 | org.quartz.core.ErrorLogger
- Job (DEFAULT.quartz-end
point71 threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See
nested exception: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint: quartz://aendHistNaechtlicherLauf?cron=0+0+23+*+*+%3F+*
due to: A Quartz job already exists with the name/group:
ewoAendHistNaechtlicherLauf/Camel]
at org.quartz.core.JobRunShell.run(JobRunShell.java:227)
at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint: quartz://aendHistNaechtlicherLauf?cron=0+0+23+*+*+%3F+*
due to: A Quartz job already exists
with the name/group: aendHistNaechtlicherLauf/Camel
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:450)
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:463)
at
org.apache.camel.component.quartz.CamelJob.execute(CamelJob.java:50)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
... 1 more
Caused by: java.lang.IllegalArgumentException: A Quartz job already exists
with the name/group: aendHistNaechtlicherLauf/Camel
at
org.apache.camel.component.quartz.QuartzComponent.createEndpoint(QuartzComponent.java:129)
at
org.apache.camel.component.quartz.QuartzComponent.createEndpoint(QuartzComponent.java:55)
at
org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:91)
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:432)
... 4 more
We belive that this error occurs because the gc deletes the endpoint
reference stored in the LRUSoftCache of EndpointRegistry. Shouldn't it be
possible that the quartz-component recreates a endpoint, when the
EndpointRegistry stores only SoftReferences? In this case the tigger should
be deleted, shouldn't it?. Elsewise there has to be a hard reference between
entpoint and trigger, so the gc can't free the endpoint reference.
Has somebody a solution or an idea why this error occurs?
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-QuartzComponent-failed-on-recreating-endpoint-tp5723760.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel QuartzComponent failed on recreating endpoint
Posted by Denis Delangle <de...@gmail.com>.
Hi,
Thanks for your answer, I'll try this in a real environment. In my
testcase, the error is not raised anymore but the process is not
executed.
(My testcase is attached here https://issues.apache.org/jira/browse/CAMEL-5993)
Denis
2013/1/21 garrydias <ga...@gmail.com>:
> It´s a nice approach.
>
> I solved my problem setting camel quartz endpoint as stateful. But this
> comes at a high cost. With around 1500 jobs I lost 18MB in heap memory
> because my Exchanges have around 25kb.
>
> Trying to solve the memory issue, I changed the RamJobStore to JdbcJobStore
> but Quartz also keeps my exchange in memory and not in its BLOB field in
> database table named QRTZ_JOB_DETAILS as I espected.
>
> So, stateful jobs is enough for me. To solve my memory issue I´ll work to
> reduce the size of my Exchange.
>
> thanx
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-QuartzComponent-failed-on-recreating-endpoint-tp5723760p5725938.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel QuartzComponent failed on recreating endpoint
Posted by garrydias <ga...@gmail.com>.
It´s a nice approach.
I solved my problem setting camel quartz endpoint as stateful. But this
comes at a high cost. With around 1500 jobs I lost 18MB in heap memory
because my Exchanges have around 25kb.
Trying to solve the memory issue, I changed the RamJobStore to JdbcJobStore
but Quartz also keeps my exchange in memory and not in its BLOB field in
database table named QRTZ_JOB_DETAILS as I espected.
So, stateful jobs is enough for me. To solve my memory issue I´ll work to
reduce the size of my Exchange.
thanx
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-QuartzComponent-failed-on-recreating-endpoint-tp5723760p5725938.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel QuartzComponent failed on recreating endpoint
Posted by Hude <fl...@googlemail.com>.
Hello,
no not really. We've changed our routes from quartz to direct. Also we've
created a CamelTriggerJob Bean. This Bean extends QuartzJobBean and has an
Producer which triggeres the direct routes.
For example:
<bean id=3D"terminTrigger"
class=3D"org.springframework.scheduling.quartz.CronTriggerBean">
<property name=3D"jobDetail" ref=3D"quartzJob" />
<property name=3D"cronExpression" value=3D"${a.schedule}" />
</bean>
<bean name=3D"quartzJob"
class=3D"org.springframework.scheduling.quartz.JobDetailBean">
<property name=3D"jobClass" value=3D"...quartz.CamelTriggerJob" />
<property name=3D"jobDataAsMap">
<map>
<entry key=3D"endpoint" value=3D"direct:termine" />
<entry key=3D"camelContext" value-ref=3D"camelContext" />
</map>
</property>
</bean>
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-QuartzComponent-failed-on-recreating-endpoint-tp5723760p5725719.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel QuartzComponent failed on recreating endpoint
Posted by garrydias <ga...@gmail.com>.
Hello
change the release solve the problem?
I´m facing the same problem in production environment when I start more than
500 quartz endpoints. The failure occurs at fire time.
I cannot reproduce this error in dev environment. The error just not
happens.
My Camel version is 2.10.1.
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-QuartzComponent-failed-on-recreating-endpoint-tp5723760p5725660.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel QuartzComponent failed on recreating endpoint
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Can you try upgrading to the latest Camel 2.9.x release?
On Fri, Dec 7, 2012 at 10:34 AM, Hude <fl...@googlemail.com> wrote:
> We're using the camel quartz component (camel version 2.9.0 and quartz in
> version 1.8.5) to trigger some jobs once a day. The routes are looking
> similar to this:
>
> from("quartz://aendHistNaechtlicherLauf?cron=0+0+23+*+*+?+*")
> .routeId(aendHistNaechtlicherLauf)
> .to("bean:aBean?method=aMethod(${header.fireTime})");
>
> BTW: We have only one camel-context.
>
> The problem is: On the first day when the application was started the routes
> are running perfect, but on the next day we are getting this exception:
>
> ERROR | 2012-12-05 23:00:00,003 | |
> | DefaultQuartzScheduler-camelContext_Worker-6 | org.quartz.core.ErrorLogger
> - Job (DEFAULT.quartz-end
> point71 threw an exception.
> org.quartz.SchedulerException: Job threw an unhandled exception. [See
> nested exception: org.apache.camel.ResolveEndpointFailedException: Failed to
> resolve endpoint: quartz://aendHistNaechtlicherLauf?cron=0+0+23+*+*+%3F+*
> due to: A Quartz job already exists with the name/group:
> ewoAendHistNaechtlicherLauf/Camel]
> at org.quartz.core.JobRunShell.run(JobRunShell.java:227)
> at
> org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
> resolve endpoint: quartz://aendHistNaechtlicherLauf?cron=0+0+23+*+*+%3F+*
> due to: A Quartz job already exists
> with the name/group: aendHistNaechtlicherLauf/Camel
> at
> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:450)
> at
> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:463)
> at
> org.apache.camel.component.quartz.CamelJob.execute(CamelJob.java:50)
> at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
> ... 1 more
> Caused by: java.lang.IllegalArgumentException: A Quartz job already exists
> with the name/group: aendHistNaechtlicherLauf/Camel
> at
> org.apache.camel.component.quartz.QuartzComponent.createEndpoint(QuartzComponent.java:129)
> at
> org.apache.camel.component.quartz.QuartzComponent.createEndpoint(QuartzComponent.java:55)
> at
> org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:91)
> at
> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:432)
> ... 4 more
>
> We belive that this error occurs because the gc deletes the endpoint
> reference stored in the LRUSoftCache of EndpointRegistry. Shouldn't it be
> possible that the quartz-component recreates a endpoint, when the
> EndpointRegistry stores only SoftReferences? In this case the tigger should
> be deleted, shouldn't it?. Elsewise there has to be a hard reference between
> entpoint and trigger, so the gc can't free the endpoint reference.
>
> Has somebody a solution or an idea why this error occurs?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-QuartzComponent-failed-on-recreating-endpoint-tp5723760.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen