You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Ingo Düppe <ma...@dueppe.com> on 2010/05/31 18:20:48 UTC
Clustering with camel-quartz
Hello,
I need to cluster my camel server and be able to simple restart the
service if a crash ocured. But I cannot figure out how to configure my
camel-quartz triggers to resume simply after a restart.
Or even worst, how to start the multiple instances of my cluster.
I always get the ObjectAlreadyExistsException from quartz.
For me it looks like that the camel-quartz component doesn't handle the
resume properly.
Normaly I would expected that
"quartz://groupname/mytimer?job.volatile=true&cron=1/5+*+*+*+*+?" would
work.
But I get an NotSerializableException due to that CamelJob is not
serializable to be stored into the db.
So I tried "quartz://groupname/mytimer?stateful=true&cron=1/5+*+*+*+*+?"
this works the first time I start the server. But starting another
server or restart the same instance an ObjectAlreadyExistsException is
thrown.
I consult google but I cannot really find any example on how to cluster
quartz with the camel-quartz component.
So my question is: Do I miss any obviously or do I have to dig into
camel-quartz code and enhance it for clustering?
Regards
Ingo
Btw. beside a few changes according to JDBC configuration I use the
quartz.properties from the quartz cluster example.
Re: Clustering with camel-quartz
Posted by Ingo Düppe <ma...@dueppe.com>.
Hi,
I added two patches to the jira issue. One for version 2.3.0 and one for
the trunk. Please check the patches and inform me if you will use them
in the next version. If you will use it then I could build my private
patched version until we can upgrade to the next up coming camel version.
Regards
Ingo
Btw. the problems with the current trunk were with the tests cases
something around camel-jetty (i guess) - but I cannot reproduce it right
now.
Re: Clustering with camel-quartz
Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Jun 24, 2010 at 7:29 PM, Ingo Düppe <ma...@dueppe.com> wrote:
> Hello,
>
> I found still some issues about clustering camel-quartz component (based
> on the current trunk version)
>
> First, why are stateful triggers are unscheduled on a graceful shutdown.
> I guess this causes, that the trigger is deleted within the database. So
> not only the node that is shutting down loses the triggers also the
> other nodes in the cluster will lost their triggers.
>
> Maybe checking if the trigger is stateful before removing on shutdown
> will help.
>
Thanks for reporting. I have just committed a fix to trunk which only
removes the job if its volatile.
trunk: 957796.
Volatile is the information according to the quartz API which dictates
if the job should be kept in the DB or not.
http://www.quartz-scheduler.org/docs/api/1.8.1/index.html
Please give it a test on your system.
> Second, see the log below. It seems that the default trigger is fired
> before it is resumed.
>
> Any suggestions?
>
> Regards
>
> Ingo
>
> INFO - TestContextManager - @TestExecutionListeners is not
> present for class [class
> crowdcode.quartz.cluster.demo.QuartzClusterTest]: using defaults.
> INFO - XmlBeanDefinitionReader - Loading XML bean definitions
> from class path resource [context-test.xml]
> INFO - CamelNamespaceHandler -
> camel-osgi.jar/camel-spring-osgi.jar not detected in classpath
> DEBUG - CamelNamespaceHandler - Using
> org.apache.camel.spring.CamelContextFactoryBean as
> CamelContextBeanDefinitionParser
> DEBUG - CamelNamespaceHandler - Registered default:
> org.apache.camel.spring.CamelProducerTemplateFactoryBean with id:
> template on camel context: camel-quartz
> DEBUG - CamelNamespaceHandler - Registered default:
> org.apache.camel.spring.CamelConsumerTemplateFactoryBean with id:
> consumerTemplate on camel context: camel-quartz
> INFO - GenericApplicationContext - Refreshing
> org.springframework.context.support.GenericApplicationContext@46dd75a4:
> display name
> [org.springframework.context.support.GenericApplicationContext@46dd75a4]; startup
> date [Thu Jun 24 19:20:18 CEST 2010]; root of context hierarchy
> INFO - GenericApplicationContext - Bean factory for application
> context
> [org.springframework.context.support.GenericApplicationContext@46dd75a4]: org.springframework.beans.factory.support.DefaultListableBeanFactory@28caea19
> DEBUG - SpringCamelContext - Set the application context
> classloader to: sun.misc.Launcher$AppClassLoader@32f4a24a
> DEBUG - AbstractCamelContextFactoryBean - Found JAXB created routes: []
> INFO - DefaultListableBeanFactory - Pre-instantiating singletons in
> org.springframework.beans.factory.support.DefaultListableBeanFactory@28caea19:
> defining beans
> [template,consumerTemplate,camel-quartz:beanPostProcessor,camel-quartz,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor];
> root of factory hierarchy
> DEBUG - SpringCamelContext - onApplicationEvent:
> org.springframework.context.event.ContextRefreshedEvent[source=org.springframework.context.support.GenericApplicationContext@46dd75a4:
> display name
> [org.springframework.context.support.GenericApplicationContext@46dd75a4]; startup
> date [Thu Jun 24 19:20:18 CEST 2010]; root of context hierarchy]
> INFO - DefaultCamelContext - Apache Camel 2.4-SNAPSHOT
> (CamelContext: camel-quartz) is starting
> INFO - DefaultCamelContext - JMX enabled. Using
> ManagedManagementStrategy.
> DEBUG - DefaultManagementAgent - Starting JMX agent on server:
> com.sun.jmx.mbeanserver.JmxMBeanServer@4aa0c486
> DEBUG - DefaultManagementAgent - Registered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=context,name="camel-quartz"
> DEBUG - DefaultManagementAgent - Registered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=DefaultTypeConverter(0x2bbef4c6)
> DEBUG - DefaultTypeConverter - Loading type converters ...
> INFO - AnnotationTypeConverterLoader - Loading file
> META-INF/services/org/apache/camel/TypeConverter to retrieve list of
> packages, from url:
> jar:file:/Users/idueppe/.m2/repository/org/apache/camel/camel-core/2.4-SNAPSHOT/camel-core-2.4-SNAPSHOT.jar!/META-INF/services/org/apache/camel/TypeConverter
> DEBUG - DefaultPackageScanClassResolver - Searching for annotations of
> org.apache.camel.Converter in packages:
> [org.apache.camel.component.file, org.apache.camel.component.bean,
> org.apache.camel.converter]
> DEBUG - DefaultPackageScanClassResolver - Found: [class
> org.apache.camel.component.file.GenericFileConverter, class
> org.apache.camel.component.bean.BeanConverter, class
> org.apache.camel.converter.CamelConverter, class
> org.apache.camel.converter.CollectionConverter, class
> org.apache.camel.converter.IOConverter, class
> org.apache.camel.converter.NIOConverter, class
> org.apache.camel.converter.ObjectConverter, class
> org.apache.camel.converter.TimePatternConverter, class
> org.apache.camel.converter.jaxp.DomConverter, class
> org.apache.camel.converter.jaxp.StaxConverter, class
> org.apache.camel.converter.jaxp.StreamSourceConverter, class
> org.apache.camel.converter.jaxp.XmlConverter, class
> org.apache.camel.converter.stream.StreamCacheConverter]
> INFO - AnnotationTypeConverterLoader - Found 3 packages with 13
> @Converter classes to load
> DEBUG - AnnotationTypeConverterLoader - Loading converter class:
> org.apache.camel.component.file.GenericFileConverter
> DEBUG - AnnotationTypeConverterLoader - Loading converter class:
> org.apache.camel.component.bean.BeanConverter
> DEBUG - AnnotationTypeConverterLoader - Loading converter class:
> org.apache.camel.converter.CamelConverter
> DEBUG - AnnotationTypeConverterLoader - Loading converter class:
> org.apache.camel.converter.CollectionConverter
> DEBUG - AnnotationTypeConverterLoader - Loading converter class:
> org.apache.camel.converter.IOConverter
> DEBUG - AnnotationTypeConverterLoader - Loading converter class:
> org.apache.camel.converter.NIOConverter
> DEBUG - AnnotationTypeConverterLoader - Loading converter class:
> org.apache.camel.converter.ObjectConverter
> DEBUG - AnnotationTypeConverterLoader - Loading converter class:
> org.apache.camel.converter.TimePatternConverter
> DEBUG - AnnotationTypeConverterLoader - Loading converter class:
> org.apache.camel.converter.jaxp.DomConverter
> DEBUG - AnnotationTypeConverterLoader - Loading converter class:
> org.apache.camel.converter.jaxp.StaxConverter
> DEBUG - AnnotationTypeConverterLoader - Loading converter class:
> org.apache.camel.converter.jaxp.StreamSourceConverter
> DEBUG - AnnotationTypeConverterLoader - Loading converter class:
> org.apache.camel.converter.jaxp.XmlConverter
> DEBUG - AnnotationTypeConverterLoader - Loading converter class:
> org.apache.camel.converter.stream.StreamCacheConverter
> DEBUG - DefaultTypeConverter - Loading type converters done
> INFO - DefaultTypeConverter - Loaded 143 type converters in
> 0.307 seconds
> DEBUG - DefaultManagementAgent - Registered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=DefaultExecutorServiceStrategy(0x2fd23e75)
> DEBUG - DefaultManagementAgent - Registered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=SharedProducerServicePool(0x14028bda)
> DEBUG - SharedProducerServicePool - Starting service pool:
> org.apache.camel.impl.SharedProducerServicePool@14028bda
> DEBUG - DefaultManagementAgent - Registered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=DefaultInflightRepository(0x35489ea3)
> DEBUG - DefaultManagementAgent - Registered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=DefaultShutdownStrategy(0x3ddd5a3d)
> DEBUG - DefaultComponent - Creating endpoint
> uri=[spring-event://default], path=[default], parameters=[{}]
> DEBUG - DefaultCamelContext - spring-event://default
> converted to endpoint: Endpoint[spring-event://default] by component:
> org.apache.camel.component.event.EventComponent@9c7eb33
> DEBUG - DefaultManagementAgent - Registered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=endpoints,name="spring-event://default"
> DEBUG - DefaultCamelContext - Starting routes...
> INFO - DefaultCamelContext - Started 0 routes
> INFO - DefaultCamelContext - Apache Camel 2.4-SNAPSHOT
> (CamelContext: camel-quartz) started in 0.488 seconds
> DEBUG - DefaultComponentResolver - Found component: mock via type:
> org.apache.camel.component.mock.MockComponent via:
> META-INF/services/org/apache/camel/component/mock
> DEBUG - DefaultManagementAgent - Registered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=components,name="mock"
> DEBUG - DefaultComponent - Creating endpoint
> uri=[mock://result], path=[result], parameters=[{}]
> DEBUG - DefaultCamelContext - mock://result converted to
> endpoint: Endpoint[mock://result] by component:
> org.apache.camel.component.mock.MockComponent@2ca2e19e
> DEBUG - DefaultManagementAgent - Registered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=endpoints,name="mock://result"
> DEBUG - DefaultCamelContext - Adding routes from builder:
> Routes: []
> DEBUG - RouteDefinition - Using AutoStartup true on
> route:
> Route[[From[quartz://crowdcode/specialtrigger?stateful=true&cron=0/1+*+*+*+*+?]]
> ->
> [process[crowdcode.quartz.cluster.demo.QuartzClusterTest$MockProcessor@79fb80c9],
> To[mock:result]]]
> DEBUG - DefaultComponentResolver - Found component: quartz via
> type: org.apache.camel.component.quartz.QuartzComponent via:
> META-INF/services/org/apache/camel/component/quartz
> DEBUG - DefaultManagementAgent - Registered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=components,name="quartz"
> INFO - SchedulerSignalerImpl - Initialized Scheduler Signaller
> of type: class org.quartz.core.SchedulerSignalerImpl
> INFO - QuartzScheduler - Quartz Scheduler v.1.8.2 created.
> INFO - JobStoreTX - Using db table-based data
> access locking (synchronization).
> INFO - JobStoreTX - JobStoreTX initialized.
> INFO - QuartzScheduler - Scheduler meta-data: Quartz
> Scheduler (v1.8.2) 'TEST' with instanceId 'MacHal.local1277400019195'
> Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
> NOT STARTED.
> Currently in standby mode.
> Number of jobs executed: 0
> Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 1 threads.
> Using job-store 'org.quartz.impl.jdbcjobstore.JobStoreTX' - which
> supports persistence. and is clustered.
>
> INFO - StdSchedulerFactory - Quartz scheduler 'TEST'
> initialized from default resource file in Quartz package:
> 'quartz.properties'
> INFO - StdSchedulerFactory - Quartz scheduler version: 1.8.2
> INFO - QuartzComponent - Starting Quartz scheduler: TEST
> DEBUG - StdRowLockSemaphore - Lock 'STATE_ACCESS' is desired
> by: main
> DEBUG - StdRowLockSemaphore - Lock 'STATE_ACCESS' is being
> obtained: main
> DEBUG - StdRowLockSemaphore - Lock 'STATE_ACCESS' given to: main
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
> desired by: main
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
> obtained: main
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
> main
> INFO - JobStoreTX - ClusterManager: detected 1
> failed or restarted instances.
> INFO - JobStoreTX - ClusterManager: Scanning for
> instance "MacHal.local1277399858770"'s failed in-progress jobs.
> INFO - JobStoreTX - ClusterManager: ......Freed 1
> acquired trigger(s).
> DEBUG - JobStoreTX - ClusterManager: ......Deleted 0
> complete triggers(s).
> DEBUG - JobStoreTX - ClusterManager: ......Scheduled
> 0 recoverable job(s) for recovery.
> DEBUG - JobStoreTX - ClusterManager:
> ......Cleaned-up 0 other failed job(s).
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
> by: main
> DEBUG - StdRowLockSemaphore - Lock 'STATE_ACCESS' returned
> by: main
> DEBUG - JobStoreTX - ClusterManager: Check-in complete.
> DEBUG - JobStoreTX - MisfireHandler: scanning for
> misfires...
> INFO - QuartzScheduler - Scheduler
> TEST_$_MacHal.local1277400019195 started.
> DEBUG - DefaultComponent - Creating endpoint
> uri=[quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true],
> path=[crowdcode/specialtrigger], parameters=[{cron=0/1 * * * * ?,
> stateful=true}]
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
> desired by: QuartzScheduler_TEST-MacHal.local1277400019195_MisfireHandler
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
> obtained: QuartzScheduler_TEST-MacHal.local1277400019195_MisfireHandler
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
> QuartzScheduler_TEST-MacHal.local1277400019195_MisfireHandler
> INFO - JobStoreTX - Handling 1 trigger(s) that
> missed their scheduled fire-time.
> DEBUG - DefaultCamelContext -
> quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
> converted to endpoint:
> Endpoint[quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true]
> by component: org.apache.camel.component.quartz.QuartzComponent@52c8c6d9
> DEBUG - DefaultManagementAgent - Registered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=QuartzEndpoint(0x7b76fb04)
> DEBUG - DefaultManagementAgent - Registered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=endpoints,name="quartz://crowdcode/specialtrigger\?cron=0%2F1+\*+\*+\*+\*+%3F&stateful=true"
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
> by: QuartzScheduler_TEST-MacHal.local1277400019195_MisfireHandler
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
> desired by: TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
> obtained: TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
> TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
> by: TEST_QuartzSchedulerThread
> DEBUG - SimpleJobFactory - Producing instance of Job
> 'DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true',
> class=org.apache.camel.component.quartz.StatefulCamelJob
> DEBUG - JobRunShell - Calling execute on job
> DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
> DEBUG - QuartzEndpoint - Firing Quartz Job with context:
> JobExecutionContext: trigger: 'crowdcode.specialtrigger job:
> DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
> fireTime: 'Thu Jun 24 19:20:19 CEST 2010 scheduledFireTime: Thu Jun 24
> 19:20:19 CEST 2010 previousFireTime: 'Thu Jun 24 19:17:43 CEST 2010
> nextFireTime: Thu Jun 24 19:20:20 CEST 2010 isRecovering: false
> refireCount: 0
> ERROR - QuartzEndpoint - Error processing exchange.
> Exchange[Message: [Body is null]]. Caused by:
> [java.lang.IllegalStateException - No processors available to process
> Exchange[Message: [Body is null]]]
> INFO - JobRunShell - Job
> DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
> threw a JobExecutionException:
> org.quartz.JobExecutionException: java.lang.IllegalStateException: No
> processors available to process Exchange[Message: [Body is null]] [See
> nested exception: java.lang.IllegalStateException: No processors
> available to process Exchange[Message: [Body is null]]]
> at
> org.apache.camel.component.quartz.QuartzEndpoint.onJobExecute(QuartzEndpoint.java:111)
> at
> org.apache.camel.component.quartz.StatefulCamelJob.execute(StatefulCamelJob.java:44)
> at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
> at
> org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
> Caused by: java.lang.IllegalStateException: No processors available to
> process Exchange[Message: [Body is null]]
> at
> org.apache.camel.processor.loadbalancer.QueueLoadBalancer.process(QueueLoadBalancer.java:41)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:53)
> at
> org.apache.camel.processor.loadbalancer.QueueLoadBalancer.process(QueueLoadBalancer.java:63)
> at
> org.apache.camel.component.quartz.QuartzEndpoint.onJobExecute(QuartzEndpoint.java:97)
> ... 3 more
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
> desired by: TEST_Worker-1
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
> obtained: TEST_Worker-1
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
> TEST_Worker-1
> DEBUG - DefaultManagementAgent - Registered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=tracer,name=Tracer(0x7fdb04ed)
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
> by: TEST_Worker-1
> DEBUG - DefaultManagementAgent - Registered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=errorhandlers,name="DefaultErrorHandlerBuilder(ref:CamelDefaultErrorHandlerBuilder)"
> DEBUG - DefaultManagementAgent - Registered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=routes,name="route1"
> DEBUG - DefaultManagementAgent - Registered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=threadpools,name=ScheduledThreadPoolExecutor(0x6f9702b1)
> DEBUG - DefaultExecutorServiceStrategy - Created new scheduled thread
> pool for source:
> DefaultErrorHandler[Instrumentation:process[TraceInterceptor[process[crowdcode.quartz.cluster.demo.QuartzClusterTest$MockProcessor@79fb80c9]]]]
> with name: RedeliveryErrorHandler-AsyncRedeliveryTask. [poolSize=10]. ->
> java.util.concurrent.ScheduledThreadPoolExecutor@6f9702b1
> DEBUG - DefaultManagementAgent - Registered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=ProducerCache(0x4ad9d6ae)
> DEBUG - MockEndpoint$1 - Starting producer:
> Producer[mock://result]
> DEBUG - ProducerCache - Adding to producer cache with
> key: Endpoint[mock://result] for producer: Producer[mock://result]
> DEBUG - DefaultManagementAgent - Registered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=processors,name=SendProcessor(0x2537e19e)
> DEBUG - DefaultCamelContext - Starting consumer (order: 1000)
> on route: route1
> DEBUG - DefaultManagementAgent - Registered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=consumers,name=QuartzConsumer(0x1bd4f279)
> DEBUG - QuartzConsumer - Starting consumer:
> Consumer[quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true]
>
> DEBUG - QuartzComponent - Resuming job using trigger:
> crowdcode/specialtrigger
>
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
> desired by: main
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
> obtained: main
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
> main
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
> by: main
> INFO - MockEndpoint - Asserting:
> Endpoint[mock://result] is satisfied
> DEBUG - MockEndpoint - Waiting on the latch for: 10000
> millis
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
> desired by: TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
> obtained: TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
> TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
> by: TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
> desired by: TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
> obtained: TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
> TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
> by: TEST_QuartzSchedulerThread
> DEBUG - SimpleJobFactory - Producing instance of Job
> 'DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true',
> class=org.apache.camel.component.quartz.StatefulCamelJob
> DEBUG - JobRunShell - Calling execute on job
> DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
> DEBUG - QuartzEndpoint - Firing Quartz Job with context:
> JobExecutionContext: trigger: 'crowdcode.specialtrigger job:
> DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
> fireTime: 'Thu Jun 24 19:20:20 CEST 2010 scheduledFireTime: Thu Jun 24
> 19:20:20 CEST 2010 previousFireTime: 'Thu Jun 24 19:20:19 CEST 2010
> nextFireTime: Thu Jun 24 19:20:21 CEST 2010 isRecovering: false
> refireCount: 0
> DEBUG - QuartzClusterTest - ##################> GOT Message
> from Quartz Exchange[Message: [Body is null]]
> DEBUG - QuartzClusterTest - ##################> GOT Message
> from Quartz with Body null
> DEBUG - SendProcessor - >>>> Endpoint[mock://result]
> Exchange[Message: Hello Again for 1]
> DEBUG - MockEndpoint - mock://result >>>> 1 :
> Exchange[Message: Hello Again for 1] with body: Hello Again for 1
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
> desired by: TEST_Worker-1
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
> obtained: TEST_Worker-1
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
> TEST_Worker-1
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
> by: TEST_Worker-1
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
> desired by: TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
> obtained: TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
> TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
> by: TEST_QuartzSchedulerThread
> DEBUG - SimpleJobFactory - Producing instance of Job
> 'DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true',
> class=org.apache.camel.component.quartz.StatefulCamelJob
> DEBUG - JobRunShell - Calling execute on job
> DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
> DEBUG - QuartzEndpoint - Firing Quartz Job with context:
> JobExecutionContext: trigger: 'crowdcode.specialtrigger job:
> DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
> fireTime: 'Thu Jun 24 19:20:21 CEST 2010 scheduledFireTime: Thu Jun 24
> 19:20:21 CEST 2010 previousFireTime: 'Thu Jun 24 19:20:20 CEST 2010
> nextFireTime: Thu Jun 24 19:20:22 CEST 2010 isRecovering: false
> refireCount: 0
> DEBUG - QuartzClusterTest - ##################> GOT Message
> from Quartz Exchange[Message: [Body is null]]
> DEBUG - QuartzClusterTest - ##################> GOT Message
> from Quartz with Body null
> DEBUG - SendProcessor - >>>> Endpoint[mock://result]
> Exchange[Message: Hello Again for 2]
> DEBUG - MockEndpoint - mock://result >>>> 2 :
> Exchange[Message: Hello Again for 2] with body: Hello Again for 2
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
> desired by: TEST_Worker-1
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
> obtained: TEST_Worker-1
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
> TEST_Worker-1
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
> by: TEST_Worker-1
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
> desired by: TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
> obtained: TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
> TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
> by: TEST_QuartzSchedulerThread
> DEBUG - SimpleJobFactory - Producing instance of Job
> 'DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true',
> class=org.apache.camel.component.quartz.StatefulCamelJob
> DEBUG - JobRunShell - Calling execute on job
> DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
> DEBUG - QuartzEndpoint - Firing Quartz Job with context:
> JobExecutionContext: trigger: 'crowdcode.specialtrigger job:
> DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
> fireTime: 'Thu Jun 24 19:20:22 CEST 2010 scheduledFireTime: Thu Jun 24
> 19:20:22 CEST 2010 previousFireTime: 'Thu Jun 24 19:20:21 CEST 2010
> nextFireTime: Thu Jun 24 19:20:23 CEST 2010 isRecovering: false
> refireCount: 0
> DEBUG - QuartzClusterTest - ##################> GOT Message
> from Quartz Exchange[Message: [Body is null]]
> DEBUG - QuartzClusterTest - ##################> GOT Message
> from Quartz with Body null
> DEBUG - SendProcessor - >>>> Endpoint[mock://result]
> Exchange[Message: Hello Again for 3]
> DEBUG - MockEndpoint - mock://result >>>> 3 :
> Exchange[Message: Hello Again for 3] with body: Hello Again for 3
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
> desired by: TEST_Worker-1
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
> obtained: TEST_Worker-1
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
> TEST_Worker-1
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
> by: TEST_Worker-1
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
> desired by: TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
> obtained: TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
> TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
> by: TEST_QuartzSchedulerThread
> DEBUG - SimpleJobFactory - Producing instance of Job
> 'DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true',
> class=org.apache.camel.component.quartz.StatefulCamelJob
> DEBUG - JobRunShell - Calling execute on job
> DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
> DEBUG - QuartzEndpoint - Firing Quartz Job with context:
> JobExecutionContext: trigger: 'crowdcode.specialtrigger job:
> DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
> fireTime: 'Thu Jun 24 19:20:23 CEST 2010 scheduledFireTime: Thu Jun 24
> 19:20:23 CEST 2010 previousFireTime: 'Thu Jun 24 19:20:22 CEST 2010
> nextFireTime: Thu Jun 24 19:20:24 CEST 2010 isRecovering: false
> refireCount: 0
> DEBUG - QuartzClusterTest - ##################> GOT Message
> from Quartz Exchange[Message: [Body is null]]
> DEBUG - QuartzClusterTest - ##################> GOT Message
> from Quartz with Body null
> DEBUG - SendProcessor - >>>> Endpoint[mock://result]
> Exchange[Message: Hello Again for 4]
> DEBUG - MockEndpoint - mock://result >>>> 4 :
> Exchange[Message: Hello Again for 4] with body: Hello Again for 4
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
> desired by: TEST_Worker-1
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
> obtained: TEST_Worker-1
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
> TEST_Worker-1
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
> by: TEST_Worker-1
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
> desired by: TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
> obtained: TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
> TEST_QuartzSchedulerThread
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
> by: TEST_QuartzSchedulerThread
> DEBUG - SimpleJobFactory - Producing instance of Job
> 'DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true',
> class=org.apache.camel.component.quartz.StatefulCamelJob
> DEBUG - JobRunShell - Calling execute on job
> DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
> DEBUG - QuartzEndpoint - Firing Quartz Job with context:
> JobExecutionContext: trigger: 'crowdcode.specialtrigger job:
> DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
> fireTime: 'Thu Jun 24 19:20:24 CEST 2010 scheduledFireTime: Thu Jun 24
> 19:20:24 CEST 2010 previousFireTime: 'Thu Jun 24 19:20:23 CEST 2010
> nextFireTime: Thu Jun 24 19:20:25 CEST 2010 isRecovering: false
> refireCount: 0
> DEBUG - QuartzClusterTest - ##################> GOT Message
> from Quartz Exchange[Message: [Body is null]]
> DEBUG - QuartzClusterTest - ##################> GOT Message
> from Quartz with Body null
> DEBUG - SendProcessor - >>>> Endpoint[mock://result]
> Exchange[Message: Hello Again for 5]
> DEBUG - MockEndpoint - mock://result >>>> 5 :
> Exchange[Message: Hello Again for 5] with body: Hello Again for 5
> DEBUG - MockEndpoint - Took 4145 millis to complete latch
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
> desired by: TEST_Worker-1
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
> obtained: TEST_Worker-1
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
> TEST_Worker-1
> INFO - GenericApplicationContext - Closing
> org.springframework.context.support.GenericApplicationContext@46dd75a4:
> display name
> [org.springframework.context.support.GenericApplicationContext@46dd75a4]; startup
> date [Thu Jun 24 19:20:18 CEST 2010]; root of context hierarchy
> DEBUG - SpringCamelContext - onApplicationEvent:
> org.springframework.context.event.ContextClosedEvent[source=org.springframework.context.support.GenericApplicationContext@46dd75a4:
> display name
> [org.springframework.context.support.GenericApplicationContext@46dd75a4]; startup
> date [Thu Jun 24 19:20:18 CEST 2010]; root of context hierarchy]
> INFO - DefaultListableBeanFactory - Destroying singletons in
> org.springframework.beans.factory.support.DefaultListableBeanFactory@28caea19:
> defining beans
> [template,consumerTemplate,camel-quartz:beanPostProcessor,camel-quartz,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor];
> root of factory hierarchy
> INFO - DefaultCamelContext - Apache Camel 2.4-SNAPSHOT
> (CamelContext:camel-quartz) is shutting down
> INFO - DefaultShutdownStrategy - Starting to graceful shutdown 1
> routes (timeout 300 seconds)
> DEBUG - DefaultExecutorServiceStrategy - Created new single thread pool
> for source: org.apache.camel.impl.DefaultShutdownStrategy@3ddd5a3d with
> name: ShutdownTask. ->
> java.util.concurrent.Executors$FinalizableDelegatedExecutorService@7b60e796
> DEBUG - DefaultShutdownStrategy - There are 1 routes to shutdown
> DEBUG - QuartzConsumer - Stopping consumer:
> Consumer[quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true]
> DEBUG - MockEndpoint$1 - Stopping producer:
> Producer[mock://result]
> DEBUG - DefaultShutdownStrategy - Shutdown complete for:
> Consumer[quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true]
> INFO - DefaultShutdownStrategy - Route: route1 shutdown
> complete, was consuming from:
> Endpoint[quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true]
> INFO - DefaultShutdownStrategy - Graceful shutdown of 1 routes
> completed in 0 seconds
> DEBUG - DefaultManagementAgent - Unregistered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=routes,name="route1"
> DEBUG - DefaultManagementAgent - Unregistered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=consumers,name=QuartzConsumer(0x1bd4f279)
> DEBUG - DefaultManagementAgent - Unregistered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=processors,name=SendProcessor(0x2537e19e)
> INFO - QuartzComponent - There are still 1 jobs
> registered in the Quartz scheduler: TEST
> DEBUG - DefaultManagementAgent - Unregistered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=context,name="camel-quartz"
> DEBUG - DefaultExecutorServiceStrategy - ShutdownNow ExecutorService:
> java.util.concurrent.Executors$FinalizableDelegatedExecutorService@7b60e796
> INFO - DefaultInflightRepository - Shutting down with no inflight
> exchanges.
> DEBUG - SharedProducerServicePool - Stopping service pool:
> org.apache.camel.impl.SharedProducerServicePool@14028bda
> DEBUG - DefaultExecutorServiceStrategy - ShutdownNow ExecutorService:
> java.util.concurrent.ScheduledThreadPoolExecutor@6f9702b1
> DEBUG - DefaultManagementAgent - Unregistered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=errorhandlers,name="DefaultErrorHandlerBuilder(ref:CamelDefaultErrorHandlerBuilder)"
> DEBUG - DefaultManagementAgent - Unregistered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=ProducerCache(0x4ad9d6ae)
> DEBUG - DefaultManagementAgent - Unregistered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=DefaultShutdownStrategy(0x3ddd5a3d)
> DEBUG - DefaultManagementAgent - Unregistered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=endpoints,name="mock://result"
> DEBUG - DefaultManagementAgent - Unregistered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=endpoints,name="spring-event://default"
> DEBUG - DefaultManagementAgent - Unregistered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=tracer,name=Tracer(0x7fdb04ed)
> DEBUG - DefaultManagementAgent - Unregistered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=QuartzEndpoint(0x7b76fb04)
> DEBUG - DefaultManagementAgent - Unregistered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=DefaultInflightRepository(0x35489ea3)
> DEBUG - DefaultManagementAgent - Unregistered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=components,name="mock"
> DEBUG - DefaultManagementAgent - Unregistered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=DefaultTypeConverter(0x2bbef4c6)
> DEBUG - DefaultManagementAgent - Unregistered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=components,name="quartz"
> DEBUG - DefaultManagementAgent - Unregistered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=endpoints,name="quartz://crowdcode/specialtrigger\?cron=0%2F1+\*+\*+\*+\*+%3F&stateful=true"
> DEBUG - DefaultManagementAgent - Unregistered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=threadpools,name=ScheduledThreadPoolExecutor(0x6f9702b1)
> DEBUG - DefaultManagementAgent - Unregistered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=DefaultExecutorServiceStrategy(0x2fd23e75)
> DEBUG - DefaultManagementAgent - Unregistered MBean with
> objectname:
> org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=SharedProducerServicePool(0x14028bda)
> INFO - DefaultCamelContext - Uptime: 5.480 seconds
> INFO - DefaultCamelContext - Apache Camel 2.4-SNAPSHOT
> (CamelContext: camel-quartz) is shutdown in 0.022 seconds
> DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
> by: TEST_Worker-1
>
>
>
>
--
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
Re: Clustering with camel-quartz
Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Jun 25, 2010 at 8:32 AM, Jim Talbut <jt...@spudsoft.co.uk> wrote:
> On 25/06/2010 06:17, Claus Ibsen wrote:
>>
>> I think the reason is the scheduler is started before the other routes
>> has been fully started. And quartz starts very quick.
>>
>> We could add an option so you can configure a delay option so it can
>> be started with delay.
>> It has a startDelayed method:
>> http://www.quartz-scheduler.org/docs/api/1.8.1/org/quartz/Scheduler.html
>>
>>
>> However a better solution is to offer this as a feature in Camel which
>> allows component to register callbacks to be invoked when all the
>> other stuff have been started, so they can start last.
>>
>>
>> I have created a ticket to track that
>> https://issues.apache.org/activemq/browse/CAMEL-2855
>>
>
Hi Jim
> In my experience* one always needs to use the delay start features of quartz
> because it always gets going before its dependents.
> Even if you have a "start last" feature, unless you make it a complex tree
> of dependencies you are going to face the situation where quartz (a late
> starter) is dependent on another late starter and you still have the race
> condition.
> Also a start-last feature doesn't work when the thing which quartz depends
> upon is outside of camel.
>
> So a start-last feature may be a good idea, but I think camel should
> probably make the delay start features of quartz available too.
>
Thanks for the input. The quartz component will now start late by
default when all the routes etc. has been started.
And there is also a new startDelayedSeconds option on quartz component
you can use to let quartz start the scheduler after X seconds.
> Jim
>
> * Which is restricted to using clustered quartz (and hence a persistent
> store for jobs) outside of camel.
>
--
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
Re: Clustering with camel-quartz
Posted by Jim Talbut <jt...@spudsoft.co.uk>.
On 25/06/2010 06:17, Claus Ibsen wrote:
> I think the reason is the scheduler is started before the other routes
> has been fully started. And quartz starts very quick.
>
> We could add an option so you can configure a delay option so it can
> be started with delay.
> It has a startDelayed method:
> http://www.quartz-scheduler.org/docs/api/1.8.1/org/quartz/Scheduler.html
>
>
> However a better solution is to offer this as a feature in Camel which
> allows component to register callbacks to be invoked when all the
> other stuff have been started, so they can start last.
>
>
> I have created a ticket to track that
> https://issues.apache.org/activemq/browse/CAMEL-2855
>
In my experience* one always needs to use the delay start features of
quartz because it always gets going before its dependents.
Even if you have a "start last" feature, unless you make it a complex
tree of dependencies you are going to face the situation where quartz (a
late starter) is dependent on another late starter and you still have
the race condition.
Also a start-last feature doesn't work when the thing which quartz
depends upon is outside of camel.
So a start-last feature may be a good idea, but I think camel should
probably make the delay start features of quartz available too.
Jim
* Which is restricted to using clustered quartz (and hence a persistent
store for jobs) outside of camel.
Re: Clustering with camel-quartz
Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Jun 24, 2010 at 7:29 PM, Ingo Düppe <ma...@dueppe.com> wrote:
> Hello,
>
> I found still some issues about clustering camel-quartz component (based
> on the current trunk version)
>
> First, why are stateful triggers are unscheduled on a graceful shutdown.
> I guess this causes, that the trigger is deleted within the database. So
> not only the node that is shutting down loses the triggers also the
> other nodes in the cluster will lost their triggers.
>
> Maybe checking if the trigger is stateful before removing on shutdown
> will help.
>
> Second, see the log below. It seems that the default trigger is fired
> before it is resumed.
>
> Any suggestions?
>
I think the reason is the scheduler is started before the other routes
has been fully started. And quartz starts very quick.
We could add an option so you can configure a delay option so it can
be started with delay.
It has a startDelayed method:
http://www.quartz-scheduler.org/docs/api/1.8.1/org/quartz/Scheduler.html
However a better solution is to offer this as a feature in Camel which
allows component to register callbacks to be invoked when all the
other stuff have been started, so they can start last.
I have created a ticket to track that
https://issues.apache.org/activemq/browse/CAMEL-2855
--
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
Re: Clustering with camel-quartz
Posted by Ingo Düppe <ma...@dueppe.com>.
Hello,
I found still some issues about clustering camel-quartz component (based
on the current trunk version)
First, why are stateful triggers are unscheduled on a graceful shutdown.
I guess this causes, that the trigger is deleted within the database. So
not only the node that is shutting down loses the triggers also the
other nodes in the cluster will lost their triggers.
Maybe checking if the trigger is stateful before removing on shutdown
will help.
Second, see the log below. It seems that the default trigger is fired
before it is resumed.
Any suggestions?
Regards
Ingo
INFO - TestContextManager - @TestExecutionListeners is not
present for class [class
crowdcode.quartz.cluster.demo.QuartzClusterTest]: using defaults.
INFO - XmlBeanDefinitionReader - Loading XML bean definitions
from class path resource [context-test.xml]
INFO - CamelNamespaceHandler -
camel-osgi.jar/camel-spring-osgi.jar not detected in classpath
DEBUG - CamelNamespaceHandler - Using
org.apache.camel.spring.CamelContextFactoryBean as
CamelContextBeanDefinitionParser
DEBUG - CamelNamespaceHandler - Registered default:
org.apache.camel.spring.CamelProducerTemplateFactoryBean with id:
template on camel context: camel-quartz
DEBUG - CamelNamespaceHandler - Registered default:
org.apache.camel.spring.CamelConsumerTemplateFactoryBean with id:
consumerTemplate on camel context: camel-quartz
INFO - GenericApplicationContext - Refreshing
org.springframework.context.support.GenericApplicationContext@46dd75a4:
display name
[org.springframework.context.support.GenericApplicationContext@46dd75a4]; startup
date [Thu Jun 24 19:20:18 CEST 2010]; root of context hierarchy
INFO - GenericApplicationContext - Bean factory for application
context
[org.springframework.context.support.GenericApplicationContext@46dd75a4]: org.springframework.beans.factory.support.DefaultListableBeanFactory@28caea19
DEBUG - SpringCamelContext - Set the application context
classloader to: sun.misc.Launcher$AppClassLoader@32f4a24a
DEBUG - AbstractCamelContextFactoryBean - Found JAXB created routes: []
INFO - DefaultListableBeanFactory - Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@28caea19:
defining beans
[template,consumerTemplate,camel-quartz:beanPostProcessor,camel-quartz,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor];
root of factory hierarchy
DEBUG - SpringCamelContext - onApplicationEvent:
org.springframework.context.event.ContextRefreshedEvent[source=org.springframework.context.support.GenericApplicationContext@46dd75a4:
display name
[org.springframework.context.support.GenericApplicationContext@46dd75a4]; startup
date [Thu Jun 24 19:20:18 CEST 2010]; root of context hierarchy]
INFO - DefaultCamelContext - Apache Camel 2.4-SNAPSHOT
(CamelContext: camel-quartz) is starting
INFO - DefaultCamelContext - JMX enabled. Using
ManagedManagementStrategy.
DEBUG - DefaultManagementAgent - Starting JMX agent on server:
com.sun.jmx.mbeanserver.JmxMBeanServer@4aa0c486
DEBUG - DefaultManagementAgent - Registered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=context,name="camel-quartz"
DEBUG - DefaultManagementAgent - Registered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=DefaultTypeConverter(0x2bbef4c6)
DEBUG - DefaultTypeConverter - Loading type converters ...
INFO - AnnotationTypeConverterLoader - Loading file
META-INF/services/org/apache/camel/TypeConverter to retrieve list of
packages, from url:
jar:file:/Users/idueppe/.m2/repository/org/apache/camel/camel-core/2.4-SNAPSHOT/camel-core-2.4-SNAPSHOT.jar!/META-INF/services/org/apache/camel/TypeConverter
DEBUG - DefaultPackageScanClassResolver - Searching for annotations of
org.apache.camel.Converter in packages:
[org.apache.camel.component.file, org.apache.camel.component.bean,
org.apache.camel.converter]
DEBUG - DefaultPackageScanClassResolver - Found: [class
org.apache.camel.component.file.GenericFileConverter, class
org.apache.camel.component.bean.BeanConverter, class
org.apache.camel.converter.CamelConverter, class
org.apache.camel.converter.CollectionConverter, class
org.apache.camel.converter.IOConverter, class
org.apache.camel.converter.NIOConverter, class
org.apache.camel.converter.ObjectConverter, class
org.apache.camel.converter.TimePatternConverter, class
org.apache.camel.converter.jaxp.DomConverter, class
org.apache.camel.converter.jaxp.StaxConverter, class
org.apache.camel.converter.jaxp.StreamSourceConverter, class
org.apache.camel.converter.jaxp.XmlConverter, class
org.apache.camel.converter.stream.StreamCacheConverter]
INFO - AnnotationTypeConverterLoader - Found 3 packages with 13
@Converter classes to load
DEBUG - AnnotationTypeConverterLoader - Loading converter class:
org.apache.camel.component.file.GenericFileConverter
DEBUG - AnnotationTypeConverterLoader - Loading converter class:
org.apache.camel.component.bean.BeanConverter
DEBUG - AnnotationTypeConverterLoader - Loading converter class:
org.apache.camel.converter.CamelConverter
DEBUG - AnnotationTypeConverterLoader - Loading converter class:
org.apache.camel.converter.CollectionConverter
DEBUG - AnnotationTypeConverterLoader - Loading converter class:
org.apache.camel.converter.IOConverter
DEBUG - AnnotationTypeConverterLoader - Loading converter class:
org.apache.camel.converter.NIOConverter
DEBUG - AnnotationTypeConverterLoader - Loading converter class:
org.apache.camel.converter.ObjectConverter
DEBUG - AnnotationTypeConverterLoader - Loading converter class:
org.apache.camel.converter.TimePatternConverter
DEBUG - AnnotationTypeConverterLoader - Loading converter class:
org.apache.camel.converter.jaxp.DomConverter
DEBUG - AnnotationTypeConverterLoader - Loading converter class:
org.apache.camel.converter.jaxp.StaxConverter
DEBUG - AnnotationTypeConverterLoader - Loading converter class:
org.apache.camel.converter.jaxp.StreamSourceConverter
DEBUG - AnnotationTypeConverterLoader - Loading converter class:
org.apache.camel.converter.jaxp.XmlConverter
DEBUG - AnnotationTypeConverterLoader - Loading converter class:
org.apache.camel.converter.stream.StreamCacheConverter
DEBUG - DefaultTypeConverter - Loading type converters done
INFO - DefaultTypeConverter - Loaded 143 type converters in
0.307 seconds
DEBUG - DefaultManagementAgent - Registered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=DefaultExecutorServiceStrategy(0x2fd23e75)
DEBUG - DefaultManagementAgent - Registered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=SharedProducerServicePool(0x14028bda)
DEBUG - SharedProducerServicePool - Starting service pool:
org.apache.camel.impl.SharedProducerServicePool@14028bda
DEBUG - DefaultManagementAgent - Registered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=DefaultInflightRepository(0x35489ea3)
DEBUG - DefaultManagementAgent - Registered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=DefaultShutdownStrategy(0x3ddd5a3d)
DEBUG - DefaultComponent - Creating endpoint
uri=[spring-event://default], path=[default], parameters=[{}]
DEBUG - DefaultCamelContext - spring-event://default
converted to endpoint: Endpoint[spring-event://default] by component:
org.apache.camel.component.event.EventComponent@9c7eb33
DEBUG - DefaultManagementAgent - Registered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=endpoints,name="spring-event://default"
DEBUG - DefaultCamelContext - Starting routes...
INFO - DefaultCamelContext - Started 0 routes
INFO - DefaultCamelContext - Apache Camel 2.4-SNAPSHOT
(CamelContext: camel-quartz) started in 0.488 seconds
DEBUG - DefaultComponentResolver - Found component: mock via type:
org.apache.camel.component.mock.MockComponent via:
META-INF/services/org/apache/camel/component/mock
DEBUG - DefaultManagementAgent - Registered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=components,name="mock"
DEBUG - DefaultComponent - Creating endpoint
uri=[mock://result], path=[result], parameters=[{}]
DEBUG - DefaultCamelContext - mock://result converted to
endpoint: Endpoint[mock://result] by component:
org.apache.camel.component.mock.MockComponent@2ca2e19e
DEBUG - DefaultManagementAgent - Registered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=endpoints,name="mock://result"
DEBUG - DefaultCamelContext - Adding routes from builder:
Routes: []
DEBUG - RouteDefinition - Using AutoStartup true on
route:
Route[[From[quartz://crowdcode/specialtrigger?stateful=true&cron=0/1+*+*+*+*+?]]
->
[process[crowdcode.quartz.cluster.demo.QuartzClusterTest$MockProcessor@79fb80c9],
To[mock:result]]]
DEBUG - DefaultComponentResolver - Found component: quartz via
type: org.apache.camel.component.quartz.QuartzComponent via:
META-INF/services/org/apache/camel/component/quartz
DEBUG - DefaultManagementAgent - Registered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=components,name="quartz"
INFO - SchedulerSignalerImpl - Initialized Scheduler Signaller
of type: class org.quartz.core.SchedulerSignalerImpl
INFO - QuartzScheduler - Quartz Scheduler v.1.8.2 created.
INFO - JobStoreTX - Using db table-based data
access locking (synchronization).
INFO - JobStoreTX - JobStoreTX initialized.
INFO - QuartzScheduler - Scheduler meta-data: Quartz
Scheduler (v1.8.2) 'TEST' with instanceId 'MacHal.local1277400019195'
Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
NOT STARTED.
Currently in standby mode.
Number of jobs executed: 0
Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 1 threads.
Using job-store 'org.quartz.impl.jdbcjobstore.JobStoreTX' - which
supports persistence. and is clustered.
INFO - StdSchedulerFactory - Quartz scheduler 'TEST'
initialized from default resource file in Quartz package:
'quartz.properties'
INFO - StdSchedulerFactory - Quartz scheduler version: 1.8.2
INFO - QuartzComponent - Starting Quartz scheduler: TEST
DEBUG - StdRowLockSemaphore - Lock 'STATE_ACCESS' is desired
by: main
DEBUG - StdRowLockSemaphore - Lock 'STATE_ACCESS' is being
obtained: main
DEBUG - StdRowLockSemaphore - Lock 'STATE_ACCESS' given to: main
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
desired by: main
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
obtained: main
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
main
INFO - JobStoreTX - ClusterManager: detected 1
failed or restarted instances.
INFO - JobStoreTX - ClusterManager: Scanning for
instance "MacHal.local1277399858770"'s failed in-progress jobs.
INFO - JobStoreTX - ClusterManager: ......Freed 1
acquired trigger(s).
DEBUG - JobStoreTX - ClusterManager: ......Deleted 0
complete triggers(s).
DEBUG - JobStoreTX - ClusterManager: ......Scheduled
0 recoverable job(s) for recovery.
DEBUG - JobStoreTX - ClusterManager:
......Cleaned-up 0 other failed job(s).
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
by: main
DEBUG - StdRowLockSemaphore - Lock 'STATE_ACCESS' returned
by: main
DEBUG - JobStoreTX - ClusterManager: Check-in complete.
DEBUG - JobStoreTX - MisfireHandler: scanning for
misfires...
INFO - QuartzScheduler - Scheduler
TEST_$_MacHal.local1277400019195 started.
DEBUG - DefaultComponent - Creating endpoint
uri=[quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true],
path=[crowdcode/specialtrigger], parameters=[{cron=0/1 * * * * ?,
stateful=true}]
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
desired by: QuartzScheduler_TEST-MacHal.local1277400019195_MisfireHandler
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
obtained: QuartzScheduler_TEST-MacHal.local1277400019195_MisfireHandler
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
QuartzScheduler_TEST-MacHal.local1277400019195_MisfireHandler
INFO - JobStoreTX - Handling 1 trigger(s) that
missed their scheduled fire-time.
DEBUG - DefaultCamelContext -
quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
converted to endpoint:
Endpoint[quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true]
by component: org.apache.camel.component.quartz.QuartzComponent@52c8c6d9
DEBUG - DefaultManagementAgent - Registered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=QuartzEndpoint(0x7b76fb04)
DEBUG - DefaultManagementAgent - Registered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=endpoints,name="quartz://crowdcode/specialtrigger\?cron=0%2F1+\*+\*+\*+\*+%3F&stateful=true"
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
by: QuartzScheduler_TEST-MacHal.local1277400019195_MisfireHandler
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
desired by: TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
obtained: TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
by: TEST_QuartzSchedulerThread
DEBUG - SimpleJobFactory - Producing instance of Job
'DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true',
class=org.apache.camel.component.quartz.StatefulCamelJob
DEBUG - JobRunShell - Calling execute on job
DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
DEBUG - QuartzEndpoint - Firing Quartz Job with context:
JobExecutionContext: trigger: 'crowdcode.specialtrigger job:
DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
fireTime: 'Thu Jun 24 19:20:19 CEST 2010 scheduledFireTime: Thu Jun 24
19:20:19 CEST 2010 previousFireTime: 'Thu Jun 24 19:17:43 CEST 2010
nextFireTime: Thu Jun 24 19:20:20 CEST 2010 isRecovering: false
refireCount: 0
ERROR - QuartzEndpoint - Error processing exchange.
Exchange[Message: [Body is null]]. Caused by:
[java.lang.IllegalStateException - No processors available to process
Exchange[Message: [Body is null]]]
INFO - JobRunShell - Job
DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
threw a JobExecutionException:
org.quartz.JobExecutionException: java.lang.IllegalStateException: No
processors available to process Exchange[Message: [Body is null]] [See
nested exception: java.lang.IllegalStateException: No processors
available to process Exchange[Message: [Body is null]]]
at
org.apache.camel.component.quartz.QuartzEndpoint.onJobExecute(QuartzEndpoint.java:111)
at
org.apache.camel.component.quartz.StatefulCamelJob.execute(StatefulCamelJob.java:44)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: java.lang.IllegalStateException: No processors available to
process Exchange[Message: [Body is null]]
at
org.apache.camel.processor.loadbalancer.QueueLoadBalancer.process(QueueLoadBalancer.java:41)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:53)
at
org.apache.camel.processor.loadbalancer.QueueLoadBalancer.process(QueueLoadBalancer.java:63)
at
org.apache.camel.component.quartz.QuartzEndpoint.onJobExecute(QuartzEndpoint.java:97)
... 3 more
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
desired by: TEST_Worker-1
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
obtained: TEST_Worker-1
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
TEST_Worker-1
DEBUG - DefaultManagementAgent - Registered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=tracer,name=Tracer(0x7fdb04ed)
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
by: TEST_Worker-1
DEBUG - DefaultManagementAgent - Registered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=errorhandlers,name="DefaultErrorHandlerBuilder(ref:CamelDefaultErrorHandlerBuilder)"
DEBUG - DefaultManagementAgent - Registered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=routes,name="route1"
DEBUG - DefaultManagementAgent - Registered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=threadpools,name=ScheduledThreadPoolExecutor(0x6f9702b1)
DEBUG - DefaultExecutorServiceStrategy - Created new scheduled thread
pool for source:
DefaultErrorHandler[Instrumentation:process[TraceInterceptor[process[crowdcode.quartz.cluster.demo.QuartzClusterTest$MockProcessor@79fb80c9]]]]
with name: RedeliveryErrorHandler-AsyncRedeliveryTask. [poolSize=10]. ->
java.util.concurrent.ScheduledThreadPoolExecutor@6f9702b1
DEBUG - DefaultManagementAgent - Registered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=ProducerCache(0x4ad9d6ae)
DEBUG - MockEndpoint$1 - Starting producer:
Producer[mock://result]
DEBUG - ProducerCache - Adding to producer cache with
key: Endpoint[mock://result] for producer: Producer[mock://result]
DEBUG - DefaultManagementAgent - Registered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=processors,name=SendProcessor(0x2537e19e)
DEBUG - DefaultCamelContext - Starting consumer (order: 1000)
on route: route1
DEBUG - DefaultManagementAgent - Registered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=consumers,name=QuartzConsumer(0x1bd4f279)
DEBUG - QuartzConsumer - Starting consumer:
Consumer[quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true]
DEBUG - QuartzComponent - Resuming job using trigger:
crowdcode/specialtrigger
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
desired by: main
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
obtained: main
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
main
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
by: main
INFO - MockEndpoint - Asserting:
Endpoint[mock://result] is satisfied
DEBUG - MockEndpoint - Waiting on the latch for: 10000
millis
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
desired by: TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
obtained: TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
by: TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
desired by: TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
obtained: TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
by: TEST_QuartzSchedulerThread
DEBUG - SimpleJobFactory - Producing instance of Job
'DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true',
class=org.apache.camel.component.quartz.StatefulCamelJob
DEBUG - JobRunShell - Calling execute on job
DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
DEBUG - QuartzEndpoint - Firing Quartz Job with context:
JobExecutionContext: trigger: 'crowdcode.specialtrigger job:
DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
fireTime: 'Thu Jun 24 19:20:20 CEST 2010 scheduledFireTime: Thu Jun 24
19:20:20 CEST 2010 previousFireTime: 'Thu Jun 24 19:20:19 CEST 2010
nextFireTime: Thu Jun 24 19:20:21 CEST 2010 isRecovering: false
refireCount: 0
DEBUG - QuartzClusterTest - ##################> GOT Message
from Quartz Exchange[Message: [Body is null]]
DEBUG - QuartzClusterTest - ##################> GOT Message
from Quartz with Body null
DEBUG - SendProcessor - >>>> Endpoint[mock://result]
Exchange[Message: Hello Again for 1]
DEBUG - MockEndpoint - mock://result >>>> 1 :
Exchange[Message: Hello Again for 1] with body: Hello Again for 1
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
desired by: TEST_Worker-1
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
obtained: TEST_Worker-1
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
TEST_Worker-1
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
by: TEST_Worker-1
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
desired by: TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
obtained: TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
by: TEST_QuartzSchedulerThread
DEBUG - SimpleJobFactory - Producing instance of Job
'DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true',
class=org.apache.camel.component.quartz.StatefulCamelJob
DEBUG - JobRunShell - Calling execute on job
DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
DEBUG - QuartzEndpoint - Firing Quartz Job with context:
JobExecutionContext: trigger: 'crowdcode.specialtrigger job:
DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
fireTime: 'Thu Jun 24 19:20:21 CEST 2010 scheduledFireTime: Thu Jun 24
19:20:21 CEST 2010 previousFireTime: 'Thu Jun 24 19:20:20 CEST 2010
nextFireTime: Thu Jun 24 19:20:22 CEST 2010 isRecovering: false
refireCount: 0
DEBUG - QuartzClusterTest - ##################> GOT Message
from Quartz Exchange[Message: [Body is null]]
DEBUG - QuartzClusterTest - ##################> GOT Message
from Quartz with Body null
DEBUG - SendProcessor - >>>> Endpoint[mock://result]
Exchange[Message: Hello Again for 2]
DEBUG - MockEndpoint - mock://result >>>> 2 :
Exchange[Message: Hello Again for 2] with body: Hello Again for 2
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
desired by: TEST_Worker-1
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
obtained: TEST_Worker-1
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
TEST_Worker-1
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
by: TEST_Worker-1
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
desired by: TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
obtained: TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
by: TEST_QuartzSchedulerThread
DEBUG - SimpleJobFactory - Producing instance of Job
'DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true',
class=org.apache.camel.component.quartz.StatefulCamelJob
DEBUG - JobRunShell - Calling execute on job
DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
DEBUG - QuartzEndpoint - Firing Quartz Job with context:
JobExecutionContext: trigger: 'crowdcode.specialtrigger job:
DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
fireTime: 'Thu Jun 24 19:20:22 CEST 2010 scheduledFireTime: Thu Jun 24
19:20:22 CEST 2010 previousFireTime: 'Thu Jun 24 19:20:21 CEST 2010
nextFireTime: Thu Jun 24 19:20:23 CEST 2010 isRecovering: false
refireCount: 0
DEBUG - QuartzClusterTest - ##################> GOT Message
from Quartz Exchange[Message: [Body is null]]
DEBUG - QuartzClusterTest - ##################> GOT Message
from Quartz with Body null
DEBUG - SendProcessor - >>>> Endpoint[mock://result]
Exchange[Message: Hello Again for 3]
DEBUG - MockEndpoint - mock://result >>>> 3 :
Exchange[Message: Hello Again for 3] with body: Hello Again for 3
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
desired by: TEST_Worker-1
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
obtained: TEST_Worker-1
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
TEST_Worker-1
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
by: TEST_Worker-1
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
desired by: TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
obtained: TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
by: TEST_QuartzSchedulerThread
DEBUG - SimpleJobFactory - Producing instance of Job
'DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true',
class=org.apache.camel.component.quartz.StatefulCamelJob
DEBUG - JobRunShell - Calling execute on job
DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
DEBUG - QuartzEndpoint - Firing Quartz Job with context:
JobExecutionContext: trigger: 'crowdcode.specialtrigger job:
DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
fireTime: 'Thu Jun 24 19:20:23 CEST 2010 scheduledFireTime: Thu Jun 24
19:20:23 CEST 2010 previousFireTime: 'Thu Jun 24 19:20:22 CEST 2010
nextFireTime: Thu Jun 24 19:20:24 CEST 2010 isRecovering: false
refireCount: 0
DEBUG - QuartzClusterTest - ##################> GOT Message
from Quartz Exchange[Message: [Body is null]]
DEBUG - QuartzClusterTest - ##################> GOT Message
from Quartz with Body null
DEBUG - SendProcessor - >>>> Endpoint[mock://result]
Exchange[Message: Hello Again for 4]
DEBUG - MockEndpoint - mock://result >>>> 4 :
Exchange[Message: Hello Again for 4] with body: Hello Again for 4
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
desired by: TEST_Worker-1
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
obtained: TEST_Worker-1
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
TEST_Worker-1
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
by: TEST_Worker-1
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
desired by: TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
obtained: TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
TEST_QuartzSchedulerThread
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
by: TEST_QuartzSchedulerThread
DEBUG - SimpleJobFactory - Producing instance of Job
'DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true',
class=org.apache.camel.component.quartz.StatefulCamelJob
DEBUG - JobRunShell - Calling execute on job
DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
DEBUG - QuartzEndpoint - Firing Quartz Job with context:
JobExecutionContext: trigger: 'crowdcode.specialtrigger job:
DEFAULT.quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true
fireTime: 'Thu Jun 24 19:20:24 CEST 2010 scheduledFireTime: Thu Jun 24
19:20:24 CEST 2010 previousFireTime: 'Thu Jun 24 19:20:23 CEST 2010
nextFireTime: Thu Jun 24 19:20:25 CEST 2010 isRecovering: false
refireCount: 0
DEBUG - QuartzClusterTest - ##################> GOT Message
from Quartz Exchange[Message: [Body is null]]
DEBUG - QuartzClusterTest - ##################> GOT Message
from Quartz with Body null
DEBUG - SendProcessor - >>>> Endpoint[mock://result]
Exchange[Message: Hello Again for 5]
DEBUG - MockEndpoint - mock://result >>>> 5 :
Exchange[Message: Hello Again for 5] with body: Hello Again for 5
DEBUG - MockEndpoint - Took 4145 millis to complete latch
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is
desired by: TEST_Worker-1
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' is being
obtained: TEST_Worker-1
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' given to:
TEST_Worker-1
INFO - GenericApplicationContext - Closing
org.springframework.context.support.GenericApplicationContext@46dd75a4:
display name
[org.springframework.context.support.GenericApplicationContext@46dd75a4]; startup
date [Thu Jun 24 19:20:18 CEST 2010]; root of context hierarchy
DEBUG - SpringCamelContext - onApplicationEvent:
org.springframework.context.event.ContextClosedEvent[source=org.springframework.context.support.GenericApplicationContext@46dd75a4:
display name
[org.springframework.context.support.GenericApplicationContext@46dd75a4]; startup
date [Thu Jun 24 19:20:18 CEST 2010]; root of context hierarchy]
INFO - DefaultListableBeanFactory - Destroying singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@28caea19:
defining beans
[template,consumerTemplate,camel-quartz:beanPostProcessor,camel-quartz,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor];
root of factory hierarchy
INFO - DefaultCamelContext - Apache Camel 2.4-SNAPSHOT
(CamelContext:camel-quartz) is shutting down
INFO - DefaultShutdownStrategy - Starting to graceful shutdown 1
routes (timeout 300 seconds)
DEBUG - DefaultExecutorServiceStrategy - Created new single thread pool
for source: org.apache.camel.impl.DefaultShutdownStrategy@3ddd5a3d with
name: ShutdownTask. ->
java.util.concurrent.Executors$FinalizableDelegatedExecutorService@7b60e796
DEBUG - DefaultShutdownStrategy - There are 1 routes to shutdown
DEBUG - QuartzConsumer - Stopping consumer:
Consumer[quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true]
DEBUG - MockEndpoint$1 - Stopping producer:
Producer[mock://result]
DEBUG - DefaultShutdownStrategy - Shutdown complete for:
Consumer[quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true]
INFO - DefaultShutdownStrategy - Route: route1 shutdown
complete, was consuming from:
Endpoint[quartz://crowdcode/specialtrigger?cron=0%2F1+*+*+*+*+%3F&stateful=true]
INFO - DefaultShutdownStrategy - Graceful shutdown of 1 routes
completed in 0 seconds
DEBUG - DefaultManagementAgent - Unregistered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=routes,name="route1"
DEBUG - DefaultManagementAgent - Unregistered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=consumers,name=QuartzConsumer(0x1bd4f279)
DEBUG - DefaultManagementAgent - Unregistered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=processors,name=SendProcessor(0x2537e19e)
INFO - QuartzComponent - There are still 1 jobs
registered in the Quartz scheduler: TEST
DEBUG - DefaultManagementAgent - Unregistered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=context,name="camel-quartz"
DEBUG - DefaultExecutorServiceStrategy - ShutdownNow ExecutorService:
java.util.concurrent.Executors$FinalizableDelegatedExecutorService@7b60e796
INFO - DefaultInflightRepository - Shutting down with no inflight
exchanges.
DEBUG - SharedProducerServicePool - Stopping service pool:
org.apache.camel.impl.SharedProducerServicePool@14028bda
DEBUG - DefaultExecutorServiceStrategy - ShutdownNow ExecutorService:
java.util.concurrent.ScheduledThreadPoolExecutor@6f9702b1
DEBUG - DefaultManagementAgent - Unregistered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=errorhandlers,name="DefaultErrorHandlerBuilder(ref:CamelDefaultErrorHandlerBuilder)"
DEBUG - DefaultManagementAgent - Unregistered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=ProducerCache(0x4ad9d6ae)
DEBUG - DefaultManagementAgent - Unregistered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=DefaultShutdownStrategy(0x3ddd5a3d)
DEBUG - DefaultManagementAgent - Unregistered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=endpoints,name="mock://result"
DEBUG - DefaultManagementAgent - Unregistered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=endpoints,name="spring-event://default"
DEBUG - DefaultManagementAgent - Unregistered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=tracer,name=Tracer(0x7fdb04ed)
DEBUG - DefaultManagementAgent - Unregistered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=QuartzEndpoint(0x7b76fb04)
DEBUG - DefaultManagementAgent - Unregistered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=DefaultInflightRepository(0x35489ea3)
DEBUG - DefaultManagementAgent - Unregistered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=components,name="mock"
DEBUG - DefaultManagementAgent - Unregistered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=DefaultTypeConverter(0x2bbef4c6)
DEBUG - DefaultManagementAgent - Unregistered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=components,name="quartz"
DEBUG - DefaultManagementAgent - Unregistered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=endpoints,name="quartz://crowdcode/specialtrigger\?cron=0%2F1+\*+\*+\*+\*+%3F&stateful=true"
DEBUG - DefaultManagementAgent - Unregistered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=threadpools,name=ScheduledThreadPoolExecutor(0x6f9702b1)
DEBUG - DefaultManagementAgent - Unregistered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=DefaultExecutorServiceStrategy(0x2fd23e75)
DEBUG - DefaultManagementAgent - Unregistered MBean with
objectname:
org.apache.camel:context=MacHal.local/camel-quartz,type=services,name=SharedProducerServicePool(0x14028bda)
INFO - DefaultCamelContext - Uptime: 5.480 seconds
INFO - DefaultCamelContext - Apache Camel 2.4-SNAPSHOT
(CamelContext: camel-quartz) is shutdown in 0.022 seconds
DEBUG - StdRowLockSemaphore - Lock 'TRIGGER_ACCESS' returned
by: TEST_Worker-1
Re: Clustering with camel-quartz
Posted by Willem Jiang <wi...@gmail.com>.
Hi
If you are using maven you can exclude the quartz from camel-quartz and
include the right version of quartz that you want.
BTW, what kind of trouble did you get when you built the trunk ?
Willem
----------------------------------
Apache Camel, Apache CXF committer
Open SOA http://www.fusesource.com
Blog http://willemjiang.blogspot.com
Tiwtter http://twitter.com/willemjiang
Ingo Düppe wrote:
> Fine, I currently work on the 2.3.0 version of /tags. Because I have
> some trouble to build the trunk.
>
> Ingo
>> On Tue, Jun 22, 2010 at 4:13 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>>
>>> Hi,
>>>
>>> does any reason exists for not upgrading camel-quartz to use the current
>>> quartz version 1.8.1?
>>>
>>>
>> Its been upgraded to 1.8.2 on trunk.
>>
>>
>>
>>> Regrads
>>>
>>> Ingo
>>>
>>> Am 04.06.10 14:36, schrieb Ingo Düppe:
>>>
>>>> Hi Claus,
>>>>
>>>> fine, I might possibly have some time on next monday to create a patch
>>>> for it.
>>>> If not then in two weeks after my vacation I will create a patch for it.
>>>>
>>>> Regards
>>>>
>>>> Ingo
>>>>
>>>> Am 04.06.10 06:55, schrieb Claus Ibsen:
>>>>
>>>>
>>>>> Hi Ingo
>>>>>
>>>>> On Thu, Jun 3, 2010 at 10:30 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>>>>>
>>>>>
>>>>>
>>>>>> Hi Claus,
>>>>>>
>>>>>> well I'm not sure if it is right. But I guess if the trigger is marked
>>>>>> as volatile it will be automatically removed within in the database.
>>>>>> Normally volatile jobs won't be stored in a db but in a cluster
>>>>>> environment they will be.
>>>>>>
>>>>>> The problem with camel is, that I cannot define an volatile trigger like
>>>>>> "quartz://trigger?job.volatility=true&cron..." and also define a cluster
>>>>>> environment within the quartz.properties. This is because CamelJob isn't
>>>>>> serializable.
>>>>>>
>>>>>> As I mentioned I haven't dig into it very deep. I just wanted to be
>>>>>> sure, that I didn't miss something obviously before I invest time into it.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> Ah thanks for point this out. I have created a ticket
>>>>> https://issues.apache.org/activemq/browse/CAMEL-2788
>>>>>
>>>>> To improve camel-quartz so you can set that volatile option and also
>>>>> see what we can about the quartz.properties etc.
>>>>> And to see how we can serialize CamelJob
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Regards
>>>>>>
>>>>>> Ingo
>>>>>>
>>>>>>
>>>>>> Am 03.06.10 15:08, schrieb Claus Ibsen:
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Hi
>>>>>>>
>>>>>>> If you have the app crash using kill -3 / -9 and then start it again
>>>>>>> and expect quartz to recover and it does not.
>>>>>>> Then I think you should ask at the Quartz user forum about this.
>>>>>>>
>>>>>>> And maybe you can create a plain example with pure Quartz to not
>>>>>>> pollute the example with Camel as the Quartz guys would just say its a
>>>>>>> Camel problem.
>>>>>>> Just as I say its most likely a Quartz problem :)
>>>>>>>
>>>>>>> And if there is something that must be configured / tweaked in Quartz
>>>>>>> to have this working then let us know. Maybe there is something we can
>>>>>>> do easier in camel-quartz for that.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Jun 3, 2010 at 12:08 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Am 01.06.10 08:37, schrieb Claus Ibsen:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> On Mon, May 31, 2010 at 6:48 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> I forgot to mention that I currently use version 2.2.0.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> Can you create a small sample application that demonstrates this? Then
>>>>>>>>> its much easier to look into it to see what / if we can do in Camel.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> - Ingo
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>> Sure, i created a small example that you can find at
>>>>>>>> http://dl.dropbox.com/u/4043036/quartz-cluster.tar.gz.
>>>>>>>>
>>>>>>>> It contains just a small JUnit Test Case (see below). The test runs fine
>>>>>>>> as long you execute the whole test. As I find out yesterday, quartz
>>>>>>>> deletes some information within the database on a clean shutdown.
>>>>>>>> So the next test run will also run fine.
>>>>>>>> But if you kill the running test - to simulate a server crash - the next
>>>>>>>> test run will end up with an exception.
>>>>>>>>
>>>>>>>> So how do I handle such inconsist data on startup of camel?
>>>>>>>>
>>>>>>>> Regards
>>>>>>>> Ingo
>>>>>>>>
>>>>>>>> @RunWith(SpringJUnit4ClassRunner.class)
>>>>>>>> @ContextConfiguration(
>>>>>>>> locations = {
>>>>>>>> "classpath*:context-test.xml"
>>>>>>>> }
>>>>>>>> )
>>>>>>>> public class QuartzClusterTest extends TestCase {
>>>>>>>>
>>>>>>>> @Autowired
>>>>>>>> private CamelContext camelContext;
>>>>>>>>
>>>>>>>> @EndpointInject(uri = "mock:result")
>>>>>>>> protected MockEndpoint resultEndpoint;
>>>>>>>>
>>>>>>>> @Test
>>>>>>>> @DirtiesContext
>>>>>>>> @Repeat(value=2)
>>>>>>>> public void testTriggering() throws Exception {
>>>>>>>> camelContext.addRoutes(new QuartzRouteBuilder());
>>>>>>>> resultEndpoint.setMinimumExpectedMessageCount(5);
>>>>>>>> resultEndpoint.setResultWaitTime(5000L);
>>>>>>>> resultEndpoint.assertIsSatisfied();
>>>>>>>> }
>>>>>>>>
>>>>>>>> public static class QuartzRouteBuilder extends RouteBuilder {
>>>>>>>>
>>>>>>>> @Override
>>>>>>>> public void configure() throws Exception {
>>>>>>>>
>>>>>>>> from("quartz://trigger?stateful=true&cron=0/1+*+*+*+*+?").to("mock:result");
>>>>>>>> }
>>>>>>>> }
>>>>>>>> }
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>>
>
>
Re: Clustering with camel-quartz
Posted by Ingo Düppe <ma...@dueppe.com>.
Fine, I currently work on the 2.3.0 version of /tags. Because I have
some trouble to build the trunk.
Ingo
> On Tue, Jun 22, 2010 at 4:13 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>
>> Hi,
>>
>> does any reason exists for not upgrading camel-quartz to use the current
>> quartz version 1.8.1?
>>
>>
> Its been upgraded to 1.8.2 on trunk.
>
>
>
>> Regrads
>>
>> Ingo
>>
>> Am 04.06.10 14:36, schrieb Ingo Düppe:
>>
>>> Hi Claus,
>>>
>>> fine, I might possibly have some time on next monday to create a patch
>>> for it.
>>> If not then in two weeks after my vacation I will create a patch for it.
>>>
>>> Regards
>>>
>>> Ingo
>>>
>>> Am 04.06.10 06:55, schrieb Claus Ibsen:
>>>
>>>
>>>> Hi Ingo
>>>>
>>>> On Thu, Jun 3, 2010 at 10:30 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>>>>
>>>>
>>>>
>>>>> Hi Claus,
>>>>>
>>>>> well I'm not sure if it is right. But I guess if the trigger is marked
>>>>> as volatile it will be automatically removed within in the database.
>>>>> Normally volatile jobs won't be stored in a db but in a cluster
>>>>> environment they will be.
>>>>>
>>>>> The problem with camel is, that I cannot define an volatile trigger like
>>>>> "quartz://trigger?job.volatility=true&cron..." and also define a cluster
>>>>> environment within the quartz.properties. This is because CamelJob isn't
>>>>> serializable.
>>>>>
>>>>> As I mentioned I haven't dig into it very deep. I just wanted to be
>>>>> sure, that I didn't miss something obviously before I invest time into it.
>>>>>
>>>>>
>>>>>
>>>>>
>>>> Ah thanks for point this out. I have created a ticket
>>>> https://issues.apache.org/activemq/browse/CAMEL-2788
>>>>
>>>> To improve camel-quartz so you can set that volatile option and also
>>>> see what we can about the quartz.properties etc.
>>>> And to see how we can serialize CamelJob
>>>>
>>>>
>>>>
>>>>
>>>>> Regards
>>>>>
>>>>> Ingo
>>>>>
>>>>>
>>>>> Am 03.06.10 15:08, schrieb Claus Ibsen:
>>>>>
>>>>>
>>>>>
>>>>>> Hi
>>>>>>
>>>>>> If you have the app crash using kill -3 / -9 and then start it again
>>>>>> and expect quartz to recover and it does not.
>>>>>> Then I think you should ask at the Quartz user forum about this.
>>>>>>
>>>>>> And maybe you can create a plain example with pure Quartz to not
>>>>>> pollute the example with Camel as the Quartz guys would just say its a
>>>>>> Camel problem.
>>>>>> Just as I say its most likely a Quartz problem :)
>>>>>>
>>>>>> And if there is something that must be configured / tweaked in Quartz
>>>>>> to have this working then let us know. Maybe there is something we can
>>>>>> do easier in camel-quartz for that.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Jun 3, 2010 at 12:08 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Am 01.06.10 08:37, schrieb Claus Ibsen:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> On Mon, May 31, 2010 at 6:48 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> I forgot to mention that I currently use version 2.2.0.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>> Can you create a small sample application that demonstrates this? Then
>>>>>>>> its much easier to look into it to see what / if we can do in Camel.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> - Ingo
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>> Sure, i created a small example that you can find at
>>>>>>> http://dl.dropbox.com/u/4043036/quartz-cluster.tar.gz.
>>>>>>>
>>>>>>> It contains just a small JUnit Test Case (see below). The test runs fine
>>>>>>> as long you execute the whole test. As I find out yesterday, quartz
>>>>>>> deletes some information within the database on a clean shutdown.
>>>>>>> So the next test run will also run fine.
>>>>>>> But if you kill the running test - to simulate a server crash - the next
>>>>>>> test run will end up with an exception.
>>>>>>>
>>>>>>> So how do I handle such inconsist data on startup of camel?
>>>>>>>
>>>>>>> Regards
>>>>>>> Ingo
>>>>>>>
>>>>>>> @RunWith(SpringJUnit4ClassRunner.class)
>>>>>>> @ContextConfiguration(
>>>>>>> locations = {
>>>>>>> "classpath*:context-test.xml"
>>>>>>> }
>>>>>>> )
>>>>>>> public class QuartzClusterTest extends TestCase {
>>>>>>>
>>>>>>> @Autowired
>>>>>>> private CamelContext camelContext;
>>>>>>>
>>>>>>> @EndpointInject(uri = "mock:result")
>>>>>>> protected MockEndpoint resultEndpoint;
>>>>>>>
>>>>>>> @Test
>>>>>>> @DirtiesContext
>>>>>>> @Repeat(value=2)
>>>>>>> public void testTriggering() throws Exception {
>>>>>>> camelContext.addRoutes(new QuartzRouteBuilder());
>>>>>>> resultEndpoint.setMinimumExpectedMessageCount(5);
>>>>>>> resultEndpoint.setResultWaitTime(5000L);
>>>>>>> resultEndpoint.assertIsSatisfied();
>>>>>>> }
>>>>>>>
>>>>>>> public static class QuartzRouteBuilder extends RouteBuilder {
>>>>>>>
>>>>>>> @Override
>>>>>>> public void configure() throws Exception {
>>>>>>>
>>>>>>> from("quartz://trigger?stateful=true&cron=0/1+*+*+*+*+?").to("mock:result");
>>>>>>> }
>>>>>>> }
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>
>
>
Re: Clustering with camel-quartz
Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Jun 22, 2010 at 4:13 PM, Ingo Düppe <ma...@dueppe.com> wrote:
> Hi,
>
> does any reason exists for not upgrading camel-quartz to use the current
> quartz version 1.8.1?
>
Its been upgraded to 1.8.2 on trunk.
> Regrads
>
> Ingo
>
> Am 04.06.10 14:36, schrieb Ingo Düppe:
>> Hi Claus,
>>
>> fine, I might possibly have some time on next monday to create a patch
>> for it.
>> If not then in two weeks after my vacation I will create a patch for it.
>>
>> Regards
>>
>> Ingo
>>
>> Am 04.06.10 06:55, schrieb Claus Ibsen:
>>
>>> Hi Ingo
>>>
>>> On Thu, Jun 3, 2010 at 10:30 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>>>
>>>
>>>> Hi Claus,
>>>>
>>>> well I'm not sure if it is right. But I guess if the trigger is marked
>>>> as volatile it will be automatically removed within in the database.
>>>> Normally volatile jobs won't be stored in a db but in a cluster
>>>> environment they will be.
>>>>
>>>> The problem with camel is, that I cannot define an volatile trigger like
>>>> "quartz://trigger?job.volatility=true&cron..." and also define a cluster
>>>> environment within the quartz.properties. This is because CamelJob isn't
>>>> serializable.
>>>>
>>>> As I mentioned I haven't dig into it very deep. I just wanted to be
>>>> sure, that I didn't miss something obviously before I invest time into it.
>>>>
>>>>
>>>>
>>> Ah thanks for point this out. I have created a ticket
>>> https://issues.apache.org/activemq/browse/CAMEL-2788
>>>
>>> To improve camel-quartz so you can set that volatile option and also
>>> see what we can about the quartz.properties etc.
>>> And to see how we can serialize CamelJob
>>>
>>>
>>>
>>>> Regards
>>>>
>>>> Ingo
>>>>
>>>>
>>>> Am 03.06.10 15:08, schrieb Claus Ibsen:
>>>>
>>>>
>>>>> Hi
>>>>>
>>>>> If you have the app crash using kill -3 / -9 and then start it again
>>>>> and expect quartz to recover and it does not.
>>>>> Then I think you should ask at the Quartz user forum about this.
>>>>>
>>>>> And maybe you can create a plain example with pure Quartz to not
>>>>> pollute the example with Camel as the Quartz guys would just say its a
>>>>> Camel problem.
>>>>> Just as I say its most likely a Quartz problem :)
>>>>>
>>>>> And if there is something that must be configured / tweaked in Quartz
>>>>> to have this working then let us know. Maybe there is something we can
>>>>> do easier in camel-quartz for that.
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Jun 3, 2010 at 12:08 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>>>>>
>>>>>
>>>>>
>>>>>> Am 01.06.10 08:37, schrieb Claus Ibsen:
>>>>>>
>>>>>>
>>>>>>
>>>>>>> On Mon, May 31, 2010 at 6:48 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> I forgot to mention that I currently use version 2.2.0.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> Can you create a small sample application that demonstrates this? Then
>>>>>>> its much easier to look into it to see what / if we can do in Camel.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> - Ingo
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> Sure, i created a small example that you can find at
>>>>>> http://dl.dropbox.com/u/4043036/quartz-cluster.tar.gz.
>>>>>>
>>>>>> It contains just a small JUnit Test Case (see below). The test runs fine
>>>>>> as long you execute the whole test. As I find out yesterday, quartz
>>>>>> deletes some information within the database on a clean shutdown.
>>>>>> So the next test run will also run fine.
>>>>>> But if you kill the running test - to simulate a server crash - the next
>>>>>> test run will end up with an exception.
>>>>>>
>>>>>> So how do I handle such inconsist data on startup of camel?
>>>>>>
>>>>>> Regards
>>>>>> Ingo
>>>>>>
>>>>>> @RunWith(SpringJUnit4ClassRunner.class)
>>>>>> @ContextConfiguration(
>>>>>> locations = {
>>>>>> "classpath*:context-test.xml"
>>>>>> }
>>>>>> )
>>>>>> public class QuartzClusterTest extends TestCase {
>>>>>>
>>>>>> @Autowired
>>>>>> private CamelContext camelContext;
>>>>>>
>>>>>> @EndpointInject(uri = "mock:result")
>>>>>> protected MockEndpoint resultEndpoint;
>>>>>>
>>>>>> @Test
>>>>>> @DirtiesContext
>>>>>> @Repeat(value=2)
>>>>>> public void testTriggering() throws Exception {
>>>>>> camelContext.addRoutes(new QuartzRouteBuilder());
>>>>>> resultEndpoint.setMinimumExpectedMessageCount(5);
>>>>>> resultEndpoint.setResultWaitTime(5000L);
>>>>>> resultEndpoint.assertIsSatisfied();
>>>>>> }
>>>>>>
>>>>>> public static class QuartzRouteBuilder extends RouteBuilder {
>>>>>>
>>>>>> @Override
>>>>>> public void configure() throws Exception {
>>>>>>
>>>>>> from("quartz://trigger?stateful=true&cron=0/1+*+*+*+*+?").to("mock:result");
>>>>>> }
>>>>>> }
>>>>>> }
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
>
--
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
Re: Clustering with camel-quartz
Posted by Ingo Düppe <ma...@dueppe.com>.
Hi,
does any reason exists for not upgrading camel-quartz to use the current
quartz version 1.8.1?
Regrads
Ingo
Am 04.06.10 14:36, schrieb Ingo Düppe:
> Hi Claus,
>
> fine, I might possibly have some time on next monday to create a patch
> for it.
> If not then in two weeks after my vacation I will create a patch for it.
>
> Regards
>
> Ingo
>
> Am 04.06.10 06:55, schrieb Claus Ibsen:
>
>> Hi Ingo
>>
>> On Thu, Jun 3, 2010 at 10:30 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>>
>>
>>> Hi Claus,
>>>
>>> well I'm not sure if it is right. But I guess if the trigger is marked
>>> as volatile it will be automatically removed within in the database.
>>> Normally volatile jobs won't be stored in a db but in a cluster
>>> environment they will be.
>>>
>>> The problem with camel is, that I cannot define an volatile trigger like
>>> "quartz://trigger?job.volatility=true&cron..." and also define a cluster
>>> environment within the quartz.properties. This is because CamelJob isn't
>>> serializable.
>>>
>>> As I mentioned I haven't dig into it very deep. I just wanted to be
>>> sure, that I didn't miss something obviously before I invest time into it.
>>>
>>>
>>>
>> Ah thanks for point this out. I have created a ticket
>> https://issues.apache.org/activemq/browse/CAMEL-2788
>>
>> To improve camel-quartz so you can set that volatile option and also
>> see what we can about the quartz.properties etc.
>> And to see how we can serialize CamelJob
>>
>>
>>
>>> Regards
>>>
>>> Ingo
>>>
>>>
>>> Am 03.06.10 15:08, schrieb Claus Ibsen:
>>>
>>>
>>>> Hi
>>>>
>>>> If you have the app crash using kill -3 / -9 and then start it again
>>>> and expect quartz to recover and it does not.
>>>> Then I think you should ask at the Quartz user forum about this.
>>>>
>>>> And maybe you can create a plain example with pure Quartz to not
>>>> pollute the example with Camel as the Quartz guys would just say its a
>>>> Camel problem.
>>>> Just as I say its most likely a Quartz problem :)
>>>>
>>>> And if there is something that must be configured / tweaked in Quartz
>>>> to have this working then let us know. Maybe there is something we can
>>>> do easier in camel-quartz for that.
>>>>
>>>>
>>>>
>>>> On Thu, Jun 3, 2010 at 12:08 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>>>>
>>>>
>>>>
>>>>> Am 01.06.10 08:37, schrieb Claus Ibsen:
>>>>>
>>>>>
>>>>>
>>>>>> On Mon, May 31, 2010 at 6:48 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> I forgot to mention that I currently use version 2.2.0.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> Can you create a small sample application that demonstrates this? Then
>>>>>> its much easier to look into it to see what / if we can do in Camel.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> - Ingo
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>> Sure, i created a small example that you can find at
>>>>> http://dl.dropbox.com/u/4043036/quartz-cluster.tar.gz.
>>>>>
>>>>> It contains just a small JUnit Test Case (see below). The test runs fine
>>>>> as long you execute the whole test. As I find out yesterday, quartz
>>>>> deletes some information within the database on a clean shutdown.
>>>>> So the next test run will also run fine.
>>>>> But if you kill the running test - to simulate a server crash - the next
>>>>> test run will end up with an exception.
>>>>>
>>>>> So how do I handle such inconsist data on startup of camel?
>>>>>
>>>>> Regards
>>>>> Ingo
>>>>>
>>>>> @RunWith(SpringJUnit4ClassRunner.class)
>>>>> @ContextConfiguration(
>>>>> locations = {
>>>>> "classpath*:context-test.xml"
>>>>> }
>>>>> )
>>>>> public class QuartzClusterTest extends TestCase {
>>>>>
>>>>> @Autowired
>>>>> private CamelContext camelContext;
>>>>>
>>>>> @EndpointInject(uri = "mock:result")
>>>>> protected MockEndpoint resultEndpoint;
>>>>>
>>>>> @Test
>>>>> @DirtiesContext
>>>>> @Repeat(value=2)
>>>>> public void testTriggering() throws Exception {
>>>>> camelContext.addRoutes(new QuartzRouteBuilder());
>>>>> resultEndpoint.setMinimumExpectedMessageCount(5);
>>>>> resultEndpoint.setResultWaitTime(5000L);
>>>>> resultEndpoint.assertIsSatisfied();
>>>>> }
>>>>>
>>>>> public static class QuartzRouteBuilder extends RouteBuilder {
>>>>>
>>>>> @Override
>>>>> public void configure() throws Exception {
>>>>>
>>>>> from("quartz://trigger?stateful=true&cron=0/1+*+*+*+*+?").to("mock:result");
>>>>> }
>>>>> }
>>>>> }
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>
>
>
Re: Clustering with camel-quartz
Posted by Ingo Düppe <ma...@dueppe.com>.
Hi Claus,
fine, I might possibly have some time on next monday to create a patch
for it.
If not then in two weeks after my vacation I will create a patch for it.
Regards
Ingo
Am 04.06.10 06:55, schrieb Claus Ibsen:
> Hi Ingo
>
> On Thu, Jun 3, 2010 at 10:30 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>
>> Hi Claus,
>>
>> well I'm not sure if it is right. But I guess if the trigger is marked
>> as volatile it will be automatically removed within in the database.
>> Normally volatile jobs won't be stored in a db but in a cluster
>> environment they will be.
>>
>> The problem with camel is, that I cannot define an volatile trigger like
>> "quartz://trigger?job.volatility=true&cron..." and also define a cluster
>> environment within the quartz.properties. This is because CamelJob isn't
>> serializable.
>>
>> As I mentioned I haven't dig into it very deep. I just wanted to be
>> sure, that I didn't miss something obviously before I invest time into it.
>>
>>
> Ah thanks for point this out. I have created a ticket
> https://issues.apache.org/activemq/browse/CAMEL-2788
>
> To improve camel-quartz so you can set that volatile option and also
> see what we can about the quartz.properties etc.
> And to see how we can serialize CamelJob
>
>
>> Regards
>>
>> Ingo
>>
>>
>> Am 03.06.10 15:08, schrieb Claus Ibsen:
>>
>>> Hi
>>>
>>> If you have the app crash using kill -3 / -9 and then start it again
>>> and expect quartz to recover and it does not.
>>> Then I think you should ask at the Quartz user forum about this.
>>>
>>> And maybe you can create a plain example with pure Quartz to not
>>> pollute the example with Camel as the Quartz guys would just say its a
>>> Camel problem.
>>> Just as I say its most likely a Quartz problem :)
>>>
>>> And if there is something that must be configured / tweaked in Quartz
>>> to have this working then let us know. Maybe there is something we can
>>> do easier in camel-quartz for that.
>>>
>>>
>>>
>>> On Thu, Jun 3, 2010 at 12:08 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>>>
>>>
>>>> Am 01.06.10 08:37, schrieb Claus Ibsen:
>>>>
>>>>
>>>>> On Mon, May 31, 2010 at 6:48 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>>>>>
>>>>>
>>>>>
>>>>>> I forgot to mention that I currently use version 2.2.0.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> Can you create a small sample application that demonstrates this? Then
>>>>> its much easier to look into it to see what / if we can do in Camel.
>>>>>
>>>>>
>>>>>
>>>>>> - Ingo
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>> Sure, i created a small example that you can find at
>>>> http://dl.dropbox.com/u/4043036/quartz-cluster.tar.gz.
>>>>
>>>> It contains just a small JUnit Test Case (see below). The test runs fine
>>>> as long you execute the whole test. As I find out yesterday, quartz
>>>> deletes some information within the database on a clean shutdown.
>>>> So the next test run will also run fine.
>>>> But if you kill the running test - to simulate a server crash - the next
>>>> test run will end up with an exception.
>>>>
>>>> So how do I handle such inconsist data on startup of camel?
>>>>
>>>> Regards
>>>> Ingo
>>>>
>>>> @RunWith(SpringJUnit4ClassRunner.class)
>>>> @ContextConfiguration(
>>>> locations = {
>>>> "classpath*:context-test.xml"
>>>> }
>>>> )
>>>> public class QuartzClusterTest extends TestCase {
>>>>
>>>> @Autowired
>>>> private CamelContext camelContext;
>>>>
>>>> @EndpointInject(uri = "mock:result")
>>>> protected MockEndpoint resultEndpoint;
>>>>
>>>> @Test
>>>> @DirtiesContext
>>>> @Repeat(value=2)
>>>> public void testTriggering() throws Exception {
>>>> camelContext.addRoutes(new QuartzRouteBuilder());
>>>> resultEndpoint.setMinimumExpectedMessageCount(5);
>>>> resultEndpoint.setResultWaitTime(5000L);
>>>> resultEndpoint.assertIsSatisfied();
>>>> }
>>>>
>>>> public static class QuartzRouteBuilder extends RouteBuilder {
>>>>
>>>> @Override
>>>> public void configure() throws Exception {
>>>>
>>>> from("quartz://trigger?stateful=true&cron=0/1+*+*+*+*+?").to("mock:result");
>>>> }
>>>> }
>>>> }
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>
>
>
Re: Clustering with camel-quartz
Posted by Claus Ibsen <cl...@gmail.com>.
Hi Ingo
On Thu, Jun 3, 2010 at 10:30 PM, Ingo Düppe <ma...@dueppe.com> wrote:
> Hi Claus,
>
> well I'm not sure if it is right. But I guess if the trigger is marked
> as volatile it will be automatically removed within in the database.
> Normally volatile jobs won't be stored in a db but in a cluster
> environment they will be.
>
> The problem with camel is, that I cannot define an volatile trigger like
> "quartz://trigger?job.volatility=true&cron..." and also define a cluster
> environment within the quartz.properties. This is because CamelJob isn't
> serializable.
>
> As I mentioned I haven't dig into it very deep. I just wanted to be
> sure, that I didn't miss something obviously before I invest time into it.
>
Ah thanks for point this out. I have created a ticket
https://issues.apache.org/activemq/browse/CAMEL-2788
To improve camel-quartz so you can set that volatile option and also
see what we can about the quartz.properties etc.
And to see how we can serialize CamelJob
> Regards
>
> Ingo
>
>
> Am 03.06.10 15:08, schrieb Claus Ibsen:
>> Hi
>>
>> If you have the app crash using kill -3 / -9 and then start it again
>> and expect quartz to recover and it does not.
>> Then I think you should ask at the Quartz user forum about this.
>>
>> And maybe you can create a plain example with pure Quartz to not
>> pollute the example with Camel as the Quartz guys would just say its a
>> Camel problem.
>> Just as I say its most likely a Quartz problem :)
>>
>> And if there is something that must be configured / tweaked in Quartz
>> to have this working then let us know. Maybe there is something we can
>> do easier in camel-quartz for that.
>>
>>
>>
>> On Thu, Jun 3, 2010 at 12:08 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>>
>>> Am 01.06.10 08:37, schrieb Claus Ibsen:
>>>
>>>> On Mon, May 31, 2010 at 6:48 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>>>>
>>>>
>>>>> I forgot to mention that I currently use version 2.2.0.
>>>>>
>>>>>
>>>>>
>>>> Can you create a small sample application that demonstrates this? Then
>>>> its much easier to look into it to see what / if we can do in Camel.
>>>>
>>>>
>>>>> - Ingo
>>>>>
>>>>>
>>>>>
>>>>>
>>> Sure, i created a small example that you can find at
>>> http://dl.dropbox.com/u/4043036/quartz-cluster.tar.gz.
>>>
>>> It contains just a small JUnit Test Case (see below). The test runs fine
>>> as long you execute the whole test. As I find out yesterday, quartz
>>> deletes some information within the database on a clean shutdown.
>>> So the next test run will also run fine.
>>> But if you kill the running test - to simulate a server crash - the next
>>> test run will end up with an exception.
>>>
>>> So how do I handle such inconsist data on startup of camel?
>>>
>>> Regards
>>> Ingo
>>>
>>> @RunWith(SpringJUnit4ClassRunner.class)
>>> @ContextConfiguration(
>>> locations = {
>>> "classpath*:context-test.xml"
>>> }
>>> )
>>> public class QuartzClusterTest extends TestCase {
>>>
>>> @Autowired
>>> private CamelContext camelContext;
>>>
>>> @EndpointInject(uri = "mock:result")
>>> protected MockEndpoint resultEndpoint;
>>>
>>> @Test
>>> @DirtiesContext
>>> @Repeat(value=2)
>>> public void testTriggering() throws Exception {
>>> camelContext.addRoutes(new QuartzRouteBuilder());
>>> resultEndpoint.setMinimumExpectedMessageCount(5);
>>> resultEndpoint.setResultWaitTime(5000L);
>>> resultEndpoint.assertIsSatisfied();
>>> }
>>>
>>> public static class QuartzRouteBuilder extends RouteBuilder {
>>>
>>> @Override
>>> public void configure() throws Exception {
>>>
>>> from("quartz://trigger?stateful=true&cron=0/1+*+*+*+*+?").to("mock:result");
>>> }
>>> }
>>> }
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
--
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
Re: Clustering with camel-quartz
Posted by Ingo Düppe <ma...@dueppe.com>.
Hi Claus,
well I'm not sure if it is right. But I guess if the trigger is marked
as volatile it will be automatically removed within in the database.
Normally volatile jobs won't be stored in a db but in a cluster
environment they will be.
The problem with camel is, that I cannot define an volatile trigger like
"quartz://trigger?job.volatility=true&cron..." and also define a cluster
environment within the quartz.properties. This is because CamelJob isn't
serializable.
As I mentioned I haven't dig into it very deep. I just wanted to be
sure, that I didn't miss something obviously before I invest time into it.
Regards
Ingo
Am 03.06.10 15:08, schrieb Claus Ibsen:
> Hi
>
> If you have the app crash using kill -3 / -9 and then start it again
> and expect quartz to recover and it does not.
> Then I think you should ask at the Quartz user forum about this.
>
> And maybe you can create a plain example with pure Quartz to not
> pollute the example with Camel as the Quartz guys would just say its a
> Camel problem.
> Just as I say its most likely a Quartz problem :)
>
> And if there is something that must be configured / tweaked in Quartz
> to have this working then let us know. Maybe there is something we can
> do easier in camel-quartz for that.
>
>
>
> On Thu, Jun 3, 2010 at 12:08 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>
>> Am 01.06.10 08:37, schrieb Claus Ibsen:
>>
>>> On Mon, May 31, 2010 at 6:48 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>>>
>>>
>>>> I forgot to mention that I currently use version 2.2.0.
>>>>
>>>>
>>>>
>>> Can you create a small sample application that demonstrates this? Then
>>> its much easier to look into it to see what / if we can do in Camel.
>>>
>>>
>>>> - Ingo
>>>>
>>>>
>>>>
>>>>
>> Sure, i created a small example that you can find at
>> http://dl.dropbox.com/u/4043036/quartz-cluster.tar.gz.
>>
>> It contains just a small JUnit Test Case (see below). The test runs fine
>> as long you execute the whole test. As I find out yesterday, quartz
>> deletes some information within the database on a clean shutdown.
>> So the next test run will also run fine.
>> But if you kill the running test - to simulate a server crash - the next
>> test run will end up with an exception.
>>
>> So how do I handle such inconsist data on startup of camel?
>>
>> Regards
>> Ingo
>>
>> @RunWith(SpringJUnit4ClassRunner.class)
>> @ContextConfiguration(
>> locations = {
>> "classpath*:context-test.xml"
>> }
>> )
>> public class QuartzClusterTest extends TestCase {
>>
>> @Autowired
>> private CamelContext camelContext;
>>
>> @EndpointInject(uri = "mock:result")
>> protected MockEndpoint resultEndpoint;
>>
>> @Test
>> @DirtiesContext
>> @Repeat(value=2)
>> public void testTriggering() throws Exception {
>> camelContext.addRoutes(new QuartzRouteBuilder());
>> resultEndpoint.setMinimumExpectedMessageCount(5);
>> resultEndpoint.setResultWaitTime(5000L);
>> resultEndpoint.assertIsSatisfied();
>> }
>>
>> public static class QuartzRouteBuilder extends RouteBuilder {
>>
>> @Override
>> public void configure() throws Exception {
>>
>> from("quartz://trigger?stateful=true&cron=0/1+*+*+*+*+?").to("mock:result");
>> }
>> }
>> }
>>
>>
>>
>>
>>
>>
>
>
>
Re: Clustering with camel-quartz
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
If you have the app crash using kill -3 / -9 and then start it again
and expect quartz to recover and it does not.
Then I think you should ask at the Quartz user forum about this.
And maybe you can create a plain example with pure Quartz to not
pollute the example with Camel as the Quartz guys would just say its a
Camel problem.
Just as I say its most likely a Quartz problem :)
And if there is something that must be configured / tweaked in Quartz
to have this working then let us know. Maybe there is something we can
do easier in camel-quartz for that.
On Thu, Jun 3, 2010 at 12:08 PM, Ingo Düppe <ma...@dueppe.com> wrote:
> Am 01.06.10 08:37, schrieb Claus Ibsen:
>> On Mon, May 31, 2010 at 6:48 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>>
>>> I forgot to mention that I currently use version 2.2.0.
>>>
>>>
>> Can you create a small sample application that demonstrates this? Then
>> its much easier to look into it to see what / if we can do in Camel.
>>
>>> - Ingo
>>>
>>>
>>>
> Sure, i created a small example that you can find at
> http://dl.dropbox.com/u/4043036/quartz-cluster.tar.gz.
>
> It contains just a small JUnit Test Case (see below). The test runs fine
> as long you execute the whole test. As I find out yesterday, quartz
> deletes some information within the database on a clean shutdown.
> So the next test run will also run fine.
> But if you kill the running test - to simulate a server crash - the next
> test run will end up with an exception.
>
> So how do I handle such inconsist data on startup of camel?
>
> Regards
> Ingo
>
> @RunWith(SpringJUnit4ClassRunner.class)
> @ContextConfiguration(
> locations = {
> "classpath*:context-test.xml"
> }
> )
> public class QuartzClusterTest extends TestCase {
>
> @Autowired
> private CamelContext camelContext;
>
> @EndpointInject(uri = "mock:result")
> protected MockEndpoint resultEndpoint;
>
> @Test
> @DirtiesContext
> @Repeat(value=2)
> public void testTriggering() throws Exception {
> camelContext.addRoutes(new QuartzRouteBuilder());
> resultEndpoint.setMinimumExpectedMessageCount(5);
> resultEndpoint.setResultWaitTime(5000L);
> resultEndpoint.assertIsSatisfied();
> }
>
> public static class QuartzRouteBuilder extends RouteBuilder {
>
> @Override
> public void configure() throws Exception {
>
> from("quartz://trigger?stateful=true&cron=0/1+*+*+*+*+?").to("mock:result");
> }
> }
> }
>
>
>
>
>
--
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
Re: Clustering with camel-quartz
Posted by Ingo Düppe <ma...@dueppe.com>.
Am 01.06.10 08:37, schrieb Claus Ibsen:
> On Mon, May 31, 2010 at 6:48 PM, Ingo Düppe <ma...@dueppe.com> wrote:
>
>> I forgot to mention that I currently use version 2.2.0.
>>
>>
> Can you create a small sample application that demonstrates this? Then
> its much easier to look into it to see what / if we can do in Camel.
>
>> - Ingo
>>
>>
>>
Sure, i created a small example that you can find at
http://dl.dropbox.com/u/4043036/quartz-cluster.tar.gz.
It contains just a small JUnit Test Case (see below). The test runs fine
as long you execute the whole test. As I find out yesterday, quartz
deletes some information within the database on a clean shutdown.
So the next test run will also run fine.
But if you kill the running test - to simulate a server crash - the next
test run will end up with an exception.
So how do I handle such inconsist data on startup of camel?
Regards
Ingo
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(
locations = {
"classpath*:context-test.xml"
}
)
public class QuartzClusterTest extends TestCase {
@Autowired
private CamelContext camelContext;
@EndpointInject(uri = "mock:result")
protected MockEndpoint resultEndpoint;
@Test
@DirtiesContext
@Repeat(value=2)
public void testTriggering() throws Exception {
camelContext.addRoutes(new QuartzRouteBuilder());
resultEndpoint.setMinimumExpectedMessageCount(5);
resultEndpoint.setResultWaitTime(5000L);
resultEndpoint.assertIsSatisfied();
}
public static class QuartzRouteBuilder extends RouteBuilder {
@Override
public void configure() throws Exception {
from("quartz://trigger?stateful=true&cron=0/1+*+*+*+*+?").to("mock:result");
}
}
}
Re: Clustering with camel-quartz
Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, May 31, 2010 at 6:48 PM, Ingo Düppe <ma...@dueppe.com> wrote:
> I forgot to mention that I currently use version 2.2.0.
>
Can you create a small sample application that demonstrates this? Then
its much easier to look into it to see what / if we can do in Camel.
> - Ingo
>
>
--
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
Re: Clustering with camel-quartz
Posted by Ingo Düppe <ma...@dueppe.com>.
I forgot to mention that I currently use version 2.2.0.
- Ingo