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

ObjectAlreadyExistsException when "redeploying" routes that uses CronScheduledRoutePolicy

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.9.2, 2.10.0
    • Fix Version/s: 2.9.3, 2.10.1
    • Component/s: camel-quartz
    • Labels:
      None
    • Patch Info:
      Patch Available
    • Estimated Complexity:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: