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

ObjectAlreadyExistsException when "redeploying" routes that uses CronScheduledRoutePolicy

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.9.2, 2.10.0
    • 2.9.3, 2.10.1
    • camel-quartz
    • None
    • Patch Available
    • Unknown

    Description

      When a route that has a CronScheduledRoutePolicy is removed it does not properly clean up the quartz jobs.

      The result (apart from possible memory leak) is that if the route is removed from the context and then readded with the same route id a ObjectAlreadyExistsException.

      This is done using the following steps.
      1. Stop the route
      2. Remove the route (and it's endpoints) from the context.
      3. (Re)add the route to the context using the same name.

      Attached is a testcase that shows the problem.

      I've solved this by adding my own implementation of onRemove (that calls doStop()) to CronScheduledRoutePolicy.

      Attachments

        1. CAMEL-5412.zip
          4 kB
          Pontus Ullgren
        2. CronScheduledRoutePolicy.patch
          0.6 kB
          Pontus Ullgren

        Activity

          People

            davsclaus Claus Ibsen
            pontus.ullgren Pontus Ullgren
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: