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

ProducerTemplate is not aligned with the lifecycle of CamelContext and therefore it's possible to have a Producer that's never shutdown correctly.

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.12.3
    • Fix Version/s: 2.13.0
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      Moderate

      Description

      ProducerTemplate is not aligned with the lifecycle of CamelContext and therefore it's possible to have a Producer that's never shutdown correctly.

              context.start();
              ProducerTemplate template = context.createProducerTemplate();
              template.sendBody("test://test", "Hello");
              context.stop();
      

      If I never call template.stop() the Producer for the test component (or indeed any other component in it's place) will never receive a call to doStop. But the Endpoint that the Producer is associated with will be stopped.. which is a weird situation/state to be in..?

      context.stop() should cleanup any and all Producers, even those created by a ProducerTemplate.. after such time a ProducerTemplate should become invalid and perhaps throw an exception that the camel context has been shutdown?

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              aaronjwhiteside Aaron Whiteside
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: