[camel] branch camel-12638 updated: CAMEL-12638: FluentProducerTemplate should be thread-safe.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[camel] branch camel-12638 updated: CAMEL-12638: FluentProducerTemplate should be thread-safe.

davsclaus-2
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-12638
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-12638 by this push:
     new efc0e95  CAMEL-12638: FluentProducerTemplate should be thread-safe.
efc0e95 is described below

commit efc0e955139565f49f3f6ffd357ba78fa288efcc
Author: Claus Ibsen <[hidden email]>
AuthorDate: Wed Aug 8 09:59:46 2018 +0200

    CAMEL-12638: FluentProducerTemplate should be thread-safe.
---
 .../java/org/apache/camel/builder/DefaultFluentProducerTemplate.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/camel-core/src/main/java/org/apache/camel/builder/DefaultFluentProducerTemplate.java b/camel-core/src/main/java/org/apache/camel/builder/DefaultFluentProducerTemplate.java
index a527fdb..b59af2f 100644
--- a/camel-core/src/main/java/org/apache/camel/builder/DefaultFluentProducerTemplate.java
+++ b/camel-core/src/main/java/org/apache/camel/builder/DefaultFluentProducerTemplate.java
@@ -17,7 +17,6 @@
 package org.apache.camel.builder;
 
 import java.util.HashMap;
-import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.Optional;
 import java.util.concurrent.Future;
@@ -139,7 +138,7 @@ public class DefaultFluentProducerTemplate extends ServiceSupport implements Flu
     public FluentProducerTemplate withHeader(String key, Object value) {
         Map<String, Object> map = headers.get();
         if (map == null) {
-            map = new LinkedHashMap<>();
+            map = new HashMap<>();
             headers.set(map);
         }
 
@@ -347,7 +346,7 @@ public class DefaultFluentProducerTemplate extends ServiceSupport implements Flu
     }
 
     private Processor defaultAsyncProcessor() {
-        final Map<String, Object> headersCopy = ObjectHelper.isNotEmpty(this.headers.get()) ? new LinkedHashMap<>(this.headers.get()) : null;
+        final Map<String, Object> headersCopy = ObjectHelper.isNotEmpty(this.headers.get()) ? new HashMap<>(this.headers.get()) : null;
         final Object bodyCopy = this.body.get();
 
         return exchange -> {