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

Producer - Add scope for singleton to allow using non singleton producers to address thread safety

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-M1
    • 2.0-M2
    • camel-core
    • None

    Description

      See CAMEL-1641 that is a bug reported about the FTP producer not being thread safe for concurrent usage.

      To address this we should consider supporting Producers to implement IsSingleton and return false to indicate that a producer should not be cached in the ProducerCache.

      We should also introduce a ProducerCallback to allow safely usages of a producer and letting Camel handle the correct resource management to

      • find the producer (singletons)
      • add to cache if needed
      • or create it
      • start it
      • invoke the callback
      • stop it for non singletons
        etc.

      In the future we can support a pool of non singleton producers as well and with this callback users of this producer can safely use it without worrying how to get it from a pool and how to safely return it back without leaking.

      Attachments

        1. CAMEL-1644b.patch
          21 kB
          Claus Ibsen

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              davsclaus Claus Ibsen
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: