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 2026/07/18 14:01:02 UTC

(camel) 01/01: CAMEL-24173: Change queue durable default to true for RabbitMQ 4.3+ compatibility

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

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

commit 8845e111bf4ff2833c1c7d683f14ab3f0648846d
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Jul 18 16:00:46 2026 +0200

    CAMEL-24173: Change queue durable default to true for RabbitMQ 4.3+ compatibility
    
    Co-Authored-By: Claude Opus 4.6 <no...@anthropic.com>
    Signed-off-by: Claus Ibsen <cl...@gmail.com>
---
 .../src/main/docs/spring-rabbitmq-component.adoc              |  4 ++--
 .../camel/component/springrabbit/SpringRabbitMQEndpoint.java  |  2 +-
 .../modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc       | 11 +++++++++++
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/components/camel-spring-parent/camel-spring-rabbitmq/src/main/docs/spring-rabbitmq-component.adoc b/components/camel-spring-parent/camel-spring-rabbitmq/src/main/docs/spring-rabbitmq-component.adoc
index 71b8c0b39f2b..728149459438 100644
--- a/components/camel-spring-parent/camel-spring-rabbitmq/src/main/docs/spring-rabbitmq-component.adoc
+++ b/components/camel-spring-parent/camel-spring-rabbitmq/src/main/docs/spring-rabbitmq-component.adoc
@@ -146,7 +146,7 @@ queue and routing keys.
 
 The elements can be configured using the multivalued `args` option.
 
-For example, to specify the queue as durable and exclusive, you can configure the endpoint uri with `arg.queue.durable=true&arg.queue.exclusive=true`.
+For example, to specify the queue as exclusive, you can configure the endpoint uri with `arg.queue.exclusive=true`.
 
 *Exchanges*
 
@@ -167,7 +167,7 @@ See details in the RabbitMQ documentation.
 |=====================================================================
 |Option |Type |Description|Default
 | autoDelete | boolean | True if the server should delete the queue when it is no longer in use (queue that has had at least one consumer is deleted when last consumer unsubscribes). | false
-| durable | boolean | A durable queue will survive a server restart. | false
+| durable | boolean | A durable queue will survive a server restart. | true
 | exclusive | boolean | Whether the queue is exclusive | false
 | x-dead-letter-exchange | String | The name of the dead letter exchange. If none configured, then the component configured value is used. |
 | x-dead-letter-routing-key | String | The routing key for the dead letter exchange. If none configured, then the component configured value is used. |
diff --git a/components/camel-spring-parent/camel-spring-rabbitmq/src/main/java/org/apache/camel/component/springrabbit/SpringRabbitMQEndpoint.java b/components/camel-spring-parent/camel-spring-rabbitmq/src/main/java/org/apache/camel/component/springrabbit/SpringRabbitMQEndpoint.java
index 1a25c8da38ab..25343414cffe 100644
--- a/components/camel-spring-parent/camel-spring-rabbitmq/src/main/java/org/apache/camel/component/springrabbit/SpringRabbitMQEndpoint.java
+++ b/components/camel-spring-parent/camel-spring-rabbitmq/src/main/java/org/apache/camel/component/springrabbit/SpringRabbitMQEndpoint.java
@@ -754,7 +754,7 @@ public class SpringRabbitMQEndpoint extends DefaultEndpoint implements AsyncEndp
                 queue = queue.trim();
                 Map<String, Object> map = getQueueArgs();
                 prepareDeadLetterQueueArgs(map);
-                boolean durable = parseArgsBoolean(map, "durable", "false");
+                boolean durable = parseArgsBoolean(map, "durable", "true");
                 boolean autoDelete = parseArgsBoolean(map, "autoDelete", autoDeleteDefault);
                 boolean exclusive = parseArgsBoolean(map, "exclusive", "false");
 
diff --git a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc
index adf398e28d3a..a899933e588e 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc
@@ -557,6 +557,17 @@ Previously, the component-level default was still 5 seconds, which would overrid
 endpoint's declared 30-second default. If you were relying on the effective 5-second timeout,
 you can restore it by explicitly setting `replyTimeout=5000` on the component or endpoint.
 
+=== camel-spring-rabbitmq - queue durable default changed to true
+
+The queue `durable` default has been changed from `false` to `true` when using `autoDeclare`.
+This aligns queues with the exchange default (which was already `durable=true`) and with RabbitMQ 4.3+
+which no longer permits non-durable, non-exclusive queues by default (the `transient_nonexcl_queues`
+deprecated feature is now denied by default).
+
+If you were relying on non-durable queues, you can restore the previous behavior by explicitly
+setting `arg.queue.durable=false&arg.queue.exclusive=true` on the endpoint URI. Note that
+RabbitMQ 4.3+ requires non-durable queues to also be exclusive.
+
 === camel-core - Multicast UseOriginalAggregationStrategy fix
 
 The Multicast EIP now correctly honors `UseOriginalAggregationStrategy`, consistent with the Splitter