Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-10606

Modify quartz2 endpoint to be a singleton

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.17.5, 2.18.2, 2.19.0
    • camel-quartz2
    • None
    • Unknown

    Description

      Currently the quartz2 endpoint implements isSingleton() and returns false.

      This causes issues if you try to do something like:

      camelContext.getEndpoint("quartz2://foo?cron=5+*+*+*+*")
      

      Which can trigger the endpoint start() method to be called and results in:

      Caused by: java.lang.IllegalArgumentException: Trigger key myGroup.longPeriodTimer is already in use by quartz2://foo/longPeriodTimer?cron=5+*+*+*+*
      	at org.apache.camel.component.quartz2.QuartzEndpoint.ensureNoDupTriggerKey(QuartzEndpoint.java:446)
      	at org.apache.camel.component.quartz2.QuartzEndpoint.addJobInScheduler(QuartzEndpoint.java:380)
      	at org.apache.camel.component.quartz2.QuartzEndpoint.doStart(QuartzEndpoint.java:340)
      

      The quartz1 endpoint implements isSingleton to return true. I see no reason why quartz2 should be any different.

      Attachments

        Issue Links

          Activity

            People

              jamesnetherton James Netherton
              jamesnetherton James Netherton
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: