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

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

commit 30e1db9b8cfe91c2cc0bb666d956db8ae75036ce
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Sun Jun 18 10:07:02 2023 +0200

    CAMEL-19373: camel-spring-rabbitmq - Fix reply timeout (#10422)
---
 .../org/apache/camel/component/springrabbit/spring-rabbitmq.json | 2 +-
 .../camel/component/springrabbit/SpringRabbitMQEndpoint.java     | 9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git 
a/components/camel-spring-rabbitmq/src/generated/resources/org/apache/camel/component/springrabbit/spring-rabbitmq.json
 
b/components/camel-spring-rabbitmq/src/generated/resources/org/apache/camel/component/springrabbit/spring-rabbitmq.json
index 44631fc3298..dc96552225d 100644
--- 
a/components/camel-spring-rabbitmq/src/generated/resources/org/apache/camel/component/springrabbit/spring-rabbitmq.json
+++ 
b/components/camel-spring-rabbitmq/src/generated/resources/org/apache/camel/component/springrabbit/spring-rabbitmq.json
@@ -88,7 +88,7 @@
     "retry": { "kind": "parameter", "displayName": "Retry", "group": "consumer 
(advanced)", "label": "consumer,advanced", "required": false, "type": "object", 
"javaType": "org.springframework.retry.interceptor.RetryOperationsInterceptor", 
"deprecated": false, "autowired": false, "secret": false, "description": 
"Custom retry configuration to use. If this is configured then the other 
settings such as maximumRetryAttempts for retry are not in use." },
     "confirm": { "kind": "parameter", "displayName": "Confirm", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "enum": [ "auto", "enabled", "disabled" ], 
"deprecated": false, "autowired": false, "secret": false, "defaultValue": 
"auto", "description": "Controls whether to wait for confirms. The connection 
factory must be configured for publisher confirms and this method. auto = Camel 
detects if the connection factory uses con [...]
     "confirmTimeout": { "kind": "parameter", "displayName": "Confirm Timeout", 
"group": "producer", "label": "producer", "required": false, "type": 
"duration", "javaType": "long", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "5000", "description": "Specify the timeout in 
milliseconds to be used when waiting for a message sent to be confirmed by 
RabbitMQ when doing send only messaging (InOnly). The default value is 5 
seconds. A negative value indicates an inde [...]
-    "replyTimeout": { "kind": "parameter", "displayName": "Reply Timeout", 
"group": "producer", "label": "producer", "required": false, "type": 
"duration", "javaType": "long", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "5000", "description": "Specify the timeout in 
milliseconds to be used when waiting for a reply message when doing 
request\/reply (InOut) messaging. The default value is 5 seconds. A negative 
value indicates an indefinite timeout." },
+    "replyTimeout": { "kind": "parameter", "displayName": "Reply Timeout", 
"group": "producer", "label": "producer", "required": false, "type": 
"duration", "javaType": "long", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "30000", "description": "Specify the timeout 
in milliseconds to be used when waiting for a reply message when doing 
request\/reply (InOut) messaging. The default value is 30 seconds. A negative 
value indicates an indefinite timeout (Beware th [...]
     "usePublisherConnection": { "kind": "parameter", "displayName": "Use 
Publisher Connection", "group": "producer", "label": "producer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": "Use 
a separate connection for publishers and consumers" },
     "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start 
Producer", "group": "producer (advanced)", "label": "producer,advanced", 
"required": false, "type": "boolean", "javaType": "boolean", "deprecated": 
false, "autowired": false, "secret": false, "defaultValue": false, 
"description": "Whether the producer should be started lazy (on the first 
message). By starting lazy you can use this to allow CamelContext and routes to 
startup in situations where a producer may other [...]
     "args": { "kind": "parameter", "displayName": "Args", "group": "advanced", 
"label": "advanced", "required": false, "type": "object", "javaType": 
"java.util.Map<java.lang.String, java.lang.Object>", "prefix": "arg.", 
"multiValue": true, "deprecated": false, "autowired": false, "secret": false, 
"description": "Specify arguments for configuring the different RabbitMQ 
concepts, a different prefix is required for each element: arg.consumer. 
arg.exchange. arg.queue. arg.binding. arg.dlq.ex [...]
diff --git 
a/components/camel-spring-rabbitmq/src/main/java/org/apache/camel/component/springrabbit/SpringRabbitMQEndpoint.java
 
b/components/camel-spring-rabbitmq/src/main/java/org/apache/camel/component/springrabbit/SpringRabbitMQEndpoint.java
index 4c7cadf9611..0f28daa6a68 100644
--- 
a/components/camel-spring-rabbitmq/src/main/java/org/apache/camel/component/springrabbit/SpringRabbitMQEndpoint.java
+++ 
b/components/camel-spring-rabbitmq/src/main/java/org/apache/camel/component/springrabbit/SpringRabbitMQEndpoint.java
@@ -146,10 +146,10 @@ public class SpringRabbitMQEndpoint extends 
DefaultEndpoint implements AsyncEndp
                             + " handles the reply message. You can also use 
this option if you want to use Camel as a proxy between different"
                             + " message brokers and you want to route message 
from one system to another.")
     private boolean disableReplyTo;
-    @UriParam(label = "producer", javaType = "java.time.Duration", 
defaultValue = "5000",
-              description = "Specify the timeout in milliseconds to be used 
when waiting for a reply message when doing request/reply (InOut) messaging."
-                            + " The default value is 5 seconds. A negative 
value indicates an indefinite timeout.")
-    private long replyTimeout = 5000;
+    @UriParam(label = "producer", javaType = "java.time.Duration", 
defaultValue = "30000",
+            description = "Specify the timeout in milliseconds to be used when 
waiting for a reply message when doing request/reply (InOut) messaging."
+                          + " The default value is 30 seconds. A negative 
value indicates an indefinite timeout (Beware that this will cause a memory 
leak if a reply is not received).")
+    private long replyTimeout = 30000;
     @UriParam(label = "producer", javaType = "java.time.Duration", 
defaultValue = "5000",
               description = "Specify the timeout in milliseconds to be used 
when waiting for a message sent to be confirmed by RabbitMQ when doing send 
only messaging (InOnly)."
                             + " The default value is 5 seconds. A negative 
value indicates an indefinite timeout.")
@@ -552,6 +552,7 @@ public class SpringRabbitMQEndpoint extends DefaultEndpoint 
implements AsyncEndp
         template.setRoutingKey(routingKey);
         template.setUsePublisherConnection(usePublisherConnection);
         AsyncRabbitTemplate asyncTemplate = new AsyncRabbitTemplate(template);
+        // use receive timeout (for reply timeout) on the async template
         asyncTemplate.setReceiveTimeout(replyTimeout);
         return asyncTemplate;
     }

Reply via email to