diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/spring-rabbitmq.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/spring-rabbitmq.json index 1e71500b7f2d5..340db9e5bec9c 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/spring-rabbitmq.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/spring-rabbitmq.json @@ -48,7 +48,7 @@ "allowNullBody": { "index": 21, "kind": "property", "displayName": "Allow Null Body", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to allow sending messages with no body. If this option is false and the message body is null, then an MessageConversionException is thrown." }, "autoDeclareProducer": { "index": 22, "kind": "property", "displayName": "Auto Declare Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Specifies whether the producer should auto declare binding between exchange, queue and routing key when starting. Enabling this can be good for development to make it easy to standup exchanges, queues and bindings on the broker." }, "lazyStartProducer": { "index": 23, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "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 otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, - "replyTimeout": { "index": 24, "kind": "property", "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 messaging. The default value is 5 seconds. A negative value indicates an indefinite timeout." }, + "replyTimeout": { "index": 24, "kind": "property", "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 messaging. The default value is 30 seconds. A negative value indicates an indefinite timeout." }, "args": { "index": 25, "kind": "property", "displayName": "Args", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map", "deprecated": false, "autowired": false, "secret": false, "description": "Specify arguments for configuring the different RabbitMQ concepts, a different prefix is required for each element: consumer. exchange. queue. binding. dlq.exchange. dlq.queue. dlq.binding. For example to declare a queue with message ttl argument: queue.x-message-ttl=60000" }, "autowiredEnabled": { "index": 26, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, "ignoreDeclarationExceptions": { "index": 27, "kind": "property", "displayName": "Ignore Declaration Exceptions", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Switch on ignore exceptions such as mismatched properties when declaring" }, diff --git a/components/camel-spring-parent/camel-spring-rabbitmq/src/generated/resources/META-INF/org/apache/camel/component/springrabbit/spring-rabbitmq.json b/components/camel-spring-parent/camel-spring-rabbitmq/src/generated/resources/META-INF/org/apache/camel/component/springrabbit/spring-rabbitmq.json index 1e71500b7f2d5..340db9e5bec9c 100644 --- a/components/camel-spring-parent/camel-spring-rabbitmq/src/generated/resources/META-INF/org/apache/camel/component/springrabbit/spring-rabbitmq.json +++ b/components/camel-spring-parent/camel-spring-rabbitmq/src/generated/resources/META-INF/org/apache/camel/component/springrabbit/spring-rabbitmq.json @@ -48,7 +48,7 @@ "allowNullBody": { "index": 21, "kind": "property", "displayName": "Allow Null Body", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to allow sending messages with no body. If this option is false and the message body is null, then an MessageConversionException is thrown." }, "autoDeclareProducer": { "index": 22, "kind": "property", "displayName": "Auto Declare Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Specifies whether the producer should auto declare binding between exchange, queue and routing key when starting. Enabling this can be good for development to make it easy to standup exchanges, queues and bindings on the broker." }, "lazyStartProducer": { "index": 23, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "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 otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, - "replyTimeout": { "index": 24, "kind": "property", "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 messaging. The default value is 5 seconds. A negative value indicates an indefinite timeout." }, + "replyTimeout": { "index": 24, "kind": "property", "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 messaging. The default value is 30 seconds. A negative value indicates an indefinite timeout." }, "args": { "index": 25, "kind": "property", "displayName": "Args", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map", "deprecated": false, "autowired": false, "secret": false, "description": "Specify arguments for configuring the different RabbitMQ concepts, a different prefix is required for each element: consumer. exchange. queue. binding. dlq.exchange. dlq.queue. dlq.binding. For example to declare a queue with message ttl argument: queue.x-message-ttl=60000" }, "autowiredEnabled": { "index": 26, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, "ignoreDeclarationExceptions": { "index": 27, "kind": "property", "displayName": "Ignore Declaration Exceptions", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Switch on ignore exceptions such as mismatched properties when declaring" }, diff --git a/components/camel-spring-parent/camel-spring-rabbitmq/src/main/java/org/apache/camel/component/springrabbit/SpringRabbitMQComponent.java b/components/camel-spring-parent/camel-spring-rabbitmq/src/main/java/org/apache/camel/component/springrabbit/SpringRabbitMQComponent.java index 14304e0996855..9ffc4173bb637 100644 --- a/components/camel-spring-parent/camel-spring-rabbitmq/src/main/java/org/apache/camel/component/springrabbit/SpringRabbitMQComponent.java +++ b/components/camel-spring-parent/camel-spring-rabbitmq/src/main/java/org/apache/camel/component/springrabbit/SpringRabbitMQComponent.java @@ -67,10 +67,10 @@ public class SpringRabbitMQComponent extends HeaderFilterStrategyComponent { @Metadata(label = "advanced", description = "To use a custom MessagePropertiesConverter so you can be in control how to map to/from a org.springframework.amqp.core.MessageProperties.") private MessagePropertiesConverter messagePropertiesConverter; - @Metadata(label = "producer", javaType = "java.time.Duration", defaultValue = "5000", + @Metadata(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 messaging." - + " The default value is 5 seconds. A negative value indicates an indefinite timeout.") - private long replyTimeout = 5000; + + " The default value is 30 seconds. A negative value indicates an indefinite timeout.") + private long replyTimeout = 30000; @Metadata(label = "consumer", description = "The name of the dead letter exchange") private String deadLetterExchange; @Metadata(label = "consumer", description = "The name of the dead letter queue") diff --git a/components/camel-spring-parent/camel-spring-rabbitmq/src/test/java/org/apache/camel/component/springrabbit/SpringRabbitMQComponentTest.java b/components/camel-spring-parent/camel-spring-rabbitmq/src/test/java/org/apache/camel/component/springrabbit/SpringRabbitMQComponentTest.java new file mode 100644 index 0000000000000..50a23f309c922 --- /dev/null +++ b/components/camel-spring-parent/camel-spring-rabbitmq/src/test/java/org/apache/camel/component/springrabbit/SpringRabbitMQComponentTest.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.springrabbit; + +import org.apache.camel.test.junit6.CamelTestSupport; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class SpringRabbitMQComponentTest extends CamelTestSupport { + + @Test + public void testReplyTimeoutDefault() throws Exception { + SpringRabbitMQEndpoint endpoint + = context.getEndpoint("spring-rabbitmq:test", SpringRabbitMQEndpoint.class); + assertEquals(30000, endpoint.getReplyTimeout(), + "replyTimeout should default to 30000 millis as documented on the endpoint option"); + } +} 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 61e5b7cd109c7..11cd02dfff4b7 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 @@ -428,6 +428,14 @@ The clustered route controller property `camel.clustered.controller.initial-dela it keeps its `String` type because it supports Camel time patterns (for example `10 seconds`) that `Duration` binding does not. +=== camel-spring-rabbitmq - replyTimeout default aligned + +The `replyTimeout` option on the component level has been fixed to default to 30 seconds, +aligning it with the endpoint-level default that was documented since Camel 3.20.7 / 3.21. +Previously, the component-level default was still 5 seconds, which would override the +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-core - Multicast UseOriginalAggregationStrategy fix The Multicast EIP now correctly honors `UseOriginalAggregationStrategy`, consistent with the Splitter diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SpringRabbitmqComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SpringRabbitmqComponentBuilderFactory.java index 07454e6bf8fcf..7fdd1b554dad3 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SpringRabbitmqComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SpringRabbitmqComponentBuilderFactory.java @@ -495,11 +495,11 @@ default SpringRabbitmqComponentBuilder lazyStartProducer(boolean lazyStartProduc /** * Specify the timeout in milliseconds to be used when waiting for a * reply message when doing request/reply messaging. The default value - * is 5 seconds. A negative value indicates an indefinite timeout. + * is 30 seconds. A negative value indicates an indefinite timeout. * * The option is a: <code>long</code> type. * - * Default: 5000 + * Default: 30000 * Group: producer * * @param replyTimeout the value to set