diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/AbstractRabbitListenerContainerFactoryConfigurer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/AbstractRabbitListenerContainerFactoryConfigurer.java index 765f5ca279e..9877d08b95e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/AbstractRabbitListenerContainerFactoryConfigurer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/AbstractRabbitListenerContainerFactoryConfigurer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,6 +47,25 @@ public abstract class AbstractRabbitListenerContainerFactoryConfigurer { + /** + * Creates a new configurer. + * @deprecated since 2.6.0 for removal in 2.8.0 in favor of + * {@link #DirectRabbitListenerContainerFactoryConfigurer(RabbitProperties)} + */ + @Deprecated + public DirectRabbitListenerContainerFactoryConfigurer() { + super(); + } + + /** + * Creates a new configurer that will use the given {@code rabbitProperties}. + * @param rabbitProperties properties to use + * @since 2.6.0 + */ + public DirectRabbitListenerContainerFactoryConfigurer(RabbitProperties rabbitProperties) { + super(rabbitProperties); + } + @Override public void configure(DirectRabbitListenerContainerFactory factory, ConnectionFactory connectionFactory) { PropertyMapper map = PropertyMapper.get(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitAnnotationDrivenConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitAnnotationDrivenConfiguration.java index a08555969d7..5cad42cfc3e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitAnnotationDrivenConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitAnnotationDrivenConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,12 +62,12 @@ class RabbitAnnotationDrivenConfiguration { @Bean @ConditionalOnMissingBean SimpleRabbitListenerContainerFactoryConfigurer simpleRabbitListenerContainerFactoryConfigurer() { - SimpleRabbitListenerContainerFactoryConfigurer configurer = new SimpleRabbitListenerContainerFactoryConfigurer(); + SimpleRabbitListenerContainerFactoryConfigurer configurer = new SimpleRabbitListenerContainerFactoryConfigurer( + this.properties); configurer.setMessageConverter(this.messageConverter.getIfUnique()); configurer.setMessageRecoverer(this.messageRecoverer.getIfUnique()); configurer.setRetryTemplateCustomizers( this.retryTemplateCustomizers.orderedStream().collect(Collectors.toList())); - configurer.setRabbitProperties(this.properties); return configurer; } @@ -85,12 +85,12 @@ class RabbitAnnotationDrivenConfiguration { @Bean @ConditionalOnMissingBean DirectRabbitListenerContainerFactoryConfigurer directRabbitListenerContainerFactoryConfigurer() { - DirectRabbitListenerContainerFactoryConfigurer configurer = new DirectRabbitListenerContainerFactoryConfigurer(); + DirectRabbitListenerContainerFactoryConfigurer configurer = new DirectRabbitListenerContainerFactoryConfigurer( + this.properties); configurer.setMessageConverter(this.messageConverter.getIfUnique()); configurer.setMessageRecoverer(this.messageRecoverer.getIfUnique()); configurer.setRetryTemplateCustomizers( this.retryTemplateCustomizers.orderedStream().collect(Collectors.toList())); - configurer.setRabbitProperties(this.properties); return configurer; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/SimpleRabbitListenerContainerFactoryConfigurer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/SimpleRabbitListenerContainerFactoryConfigurer.java index cef9bffcfd2..7406a1b5e6c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/SimpleRabbitListenerContainerFactoryConfigurer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/SimpleRabbitListenerContainerFactoryConfigurer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,6 +31,25 @@ import org.springframework.boot.context.properties.PropertyMapper; public final class SimpleRabbitListenerContainerFactoryConfigurer extends AbstractRabbitListenerContainerFactoryConfigurer { + /** + * Creates a new configurer. + * @deprecated since 2.6.0 for removal in 2.8.0 in favor of + * {@link #SimpleRabbitListenerContainerFactoryConfigurer(RabbitProperties)} + */ + @Deprecated + public SimpleRabbitListenerContainerFactoryConfigurer() { + super(); + } + + /** + * Creates a new configurer that will use the given {@code rabbitProperties}. + * @param rabbitProperties properties to use + * @since 2.6.0 + */ + public SimpleRabbitListenerContainerFactoryConfigurer(RabbitProperties rabbitProperties) { + super(rabbitProperties); + } + @Override public void configure(SimpleRabbitListenerContainerFactory factory, ConnectionFactory connectionFactory) { PropertyMapper map = PropertyMapper.get();