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

DefaultFluentProducerTemplate mixes up data when sending asynchronously

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.18.2
    • Fix Version/s: 2.18.4, 2.19.0
    • Component/s: camel-core
    • Labels:
      None
    • Environment:

      eclipse, win7, gradle

    • Estimated Complexity:
      Unknown

      Description

      DefaultFluentProducerTemplate

      code:

      producer = context.createFluentProducerTemplate();

      future1 = producer.withHeader("action", "register").withBody(body1).asyncSend();
      future2 = producer.withHeader("action", "register").withBody(body2).asyncSend();

      These two subsequent calls produces with the default creation two calls with the same body - body2.
      The cause is that it uses default processor supplier () -> this::populateExchange which is call lazily at the time of send and at that time the body property of DefaultFluentProducerTemplate is body2.

        Attachments

        1. default_fluent_producer_template.diff
          2 kB
          Jakub Cernohorsky

          Activity

            People

            • Assignee:
              lb Luca Burgazzoli
              Reporter:
              jub Jakub Cernohorsky
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: