diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java index a7e318e930..1bbc401fd4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java @@ -119,11 +119,11 @@ public class RabbitProperties { * Connection timeout. Set it to zero to wait forever. */ private Duration connectionTimeout; - + /** - * Channel RPC timeout. + * Continuation timeout for RPC calls in channels. Set it to zero to wait forever. */ - private Duration channelRpcTimeout; + private Duration channelRpcTimeout = Duration.ofMinutes(10); /** * Cache configuration. @@ -328,10 +328,6 @@ public class RabbitProperties { public Duration getConnectionTimeout() { return this.connectionTimeout; } - - public Duration getChannelRpcTimeout() { - return this.channelRpcTimeout; - } public void setPublisherConfirmType(ConfirmType publisherConfirmType) { this.publisherConfirmType = publisherConfirmType; @@ -344,7 +340,11 @@ public class RabbitProperties { public void setConnectionTimeout(Duration connectionTimeout) { this.connectionTimeout = connectionTimeout; } - + + public Duration getChannelRpcTimeout() { + return this.channelRpcTimeout; + } + public void setChannelRpcTimeout(Duration channelRpcTimeout) { this.channelRpcTimeout = channelRpcTimeout; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java index ccd2e7aabe..811c9111be 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java @@ -108,6 +108,8 @@ class RabbitAutoConfigurationTests { .isEqualTo(com.rabbitmq.client.ConnectionFactory.DEFAULT_CHANNEL_MAX); assertThat(connectionFactory.isPublisherConfirms()).isFalse(); assertThat(connectionFactory.isPublisherReturns()).isFalse(); + assertThat(connectionFactory.getRabbitConnectionFactory().getChannelRpcTimeout()) + .isEqualTo(com.rabbitmq.client.ConnectionFactory.DEFAULT_CHANNEL_RPC_TIMEOUT); assertThat(context.containsBean("rabbitListenerContainerFactory")) .as("Listener container factory should be created by default").isTrue(); });