You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2021/03/23 06:20:12 UTC

[camel] branch master updated: CAMEL-16316: Add javadoc about thread-safety with transformer processor in asyncSend methods on ProducerTemplatate.

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

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


The following commit(s) were added to refs/heads/master by this push:
     new f5ef86c  CAMEL-16316: Add javadoc about thread-safety with transformer processor in asyncSend methods on ProducerTemplatate.
f5ef86c is described below

commit f5ef86cfacfa7c44dd552436bbb2f445923c5eea
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Mar 23 07:19:44 2021 +0100

    CAMEL-16316: Add javadoc about thread-safety with transformer processor in asyncSend methods on ProducerTemplatate.
---
 .../src/main/java/org/apache/camel/ProducerTemplate.java | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/core/camel-api/src/main/java/org/apache/camel/ProducerTemplate.java b/core/camel-api/src/main/java/org/apache/camel/ProducerTemplate.java
index b2cda3c..2139631 100644
--- a/core/camel-api/src/main/java/org/apache/camel/ProducerTemplate.java
+++ b/core/camel-api/src/main/java/org/apache/camel/ProducerTemplate.java
@@ -928,6 +928,10 @@ public interface ProducerTemplate extends Service {
     /**
      * Sends an asynchronous exchange to the given endpoint.
      *
+     * <b>Important:</b> The transformer processor is invoked by a thread from the underlying thread pool,
+     * when the task is running to send the exchange asynchronously. In other words mind about thread-safety
+     * when using the transformer processor.
+     *
      * @param  endpointUri the endpoint URI to send the exchange to
      * @param  processor   the transformer used to populate the new exchange
      * @return             a handle to be used to get the response in the future
@@ -1021,6 +1025,10 @@ public interface ProducerTemplate extends Service {
     /**
      * Sends an asynchronous exchange to the given endpoint.
      *
+     * <b>Important:</b> The transformer processor is invoked by a thread from the underlying thread pool,
+     * when the task is running to send the exchange asynchronously. In other words mind about thread-safety
+     * when using the transformer processor.
+
      * @param  endpoint  the endpoint to send the exchange to
      * @param  processor the transformer used to populate the new exchange
      * @return           a handle to be used to get the response in the future
@@ -1143,6 +1151,7 @@ public interface ProducerTemplate extends Service {
      * @param  onCompletion callback invoked when exchange has been completed
      * @return              a handle to be used to get the response in the future
      */
+    @Deprecated
     CompletableFuture<Exchange> asyncCallback(String endpointUri, Exchange exchange, Synchronization onCompletion);
 
     /**
@@ -1153,6 +1162,7 @@ public interface ProducerTemplate extends Service {
      * @param  onCompletion callback invoked when exchange has been completed
      * @return              a handle to be used to get the response in the future
      */
+    @Deprecated
     CompletableFuture<Exchange> asyncCallback(Endpoint endpoint, Exchange exchange, Synchronization onCompletion);
 
     /**
@@ -1163,6 +1173,7 @@ public interface ProducerTemplate extends Service {
      * @param  onCompletion callback invoked when exchange has been completed
      * @return              a handle to be used to get the response in the future
      */
+    @Deprecated
     CompletableFuture<Exchange> asyncCallback(String endpointUri, Processor processor, Synchronization onCompletion);
 
     /**
@@ -1173,6 +1184,7 @@ public interface ProducerTemplate extends Service {
      * @param  onCompletion callback invoked when exchange has been completed
      * @return              a handle to be used to get the response in the future
      */
+    @Deprecated
     CompletableFuture<Exchange> asyncCallback(Endpoint endpoint, Processor processor, Synchronization onCompletion);
 
     /**
@@ -1184,6 +1196,7 @@ public interface ProducerTemplate extends Service {
      * @param  onCompletion callback invoked when exchange has been completed
      * @return              a handle to be used to get the response in the future
      */
+    @Deprecated
     CompletableFuture<Object> asyncCallbackSendBody(String endpointUri, Object body, Synchronization onCompletion);
 
     /**
@@ -1195,6 +1208,7 @@ public interface ProducerTemplate extends Service {
      * @param  onCompletion callback invoked when exchange has been completed
      * @return              a handle to be used to get the response in the future
      */
+    @Deprecated
     CompletableFuture<Object> asyncCallbackSendBody(Endpoint endpoint, Object body, Synchronization onCompletion);
 
     /**
@@ -1205,6 +1219,7 @@ public interface ProducerTemplate extends Service {
      * @param  onCompletion callback invoked when exchange has been completed
      * @return              a handle to be used to get the response in the future
      */
+    @Deprecated
     CompletableFuture<Object> asyncCallbackRequestBody(String endpointUri, Object body, Synchronization onCompletion);
 
     /**
@@ -1215,6 +1230,7 @@ public interface ProducerTemplate extends Service {
      * @param  onCompletion callback invoked when exchange has been completed
      * @return              a handle to be used to get the response in the future
      */
+    @Deprecated
     CompletableFuture<Object> asyncCallbackRequestBody(Endpoint endpoint, Object body, Synchronization onCompletion);
 
 }