diff --git a/spring-rabbit-confirms-returns/pom.xml b/spring-rabbit-confirms-returns/pom.xml index 5664edb..48a68e9 100644 --- a/spring-rabbit-confirms-returns/pom.xml +++ b/spring-rabbit-confirms-returns/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.5.RELEASE + 2.0.6.RELEASE diff --git a/spring-rabbit-global-errorhandler/pom.xml b/spring-rabbit-global-errorhandler/pom.xml index b01b11b..bf6abfc 100644 --- a/spring-rabbit-global-errorhandler/pom.xml +++ b/spring-rabbit-global-errorhandler/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.5.RELEASE + 2.0.6.RELEASE diff --git a/spring-rabbit-global-errorhandler/src/main/java/org/springframework/amqp/samples/errorhandler/Application.java b/spring-rabbit-global-errorhandler/src/main/java/org/springframework/amqp/samples/errorhandler/Application.java index ba65045..3a46805 100644 --- a/spring-rabbit-global-errorhandler/src/main/java/org/springframework/amqp/samples/errorhandler/Application.java +++ b/spring-rabbit-global-errorhandler/src/main/java/org/springframework/amqp/samples/errorhandler/Application.java @@ -15,6 +15,7 @@ import org.springframework.amqp.support.converter.MessageConverter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.amqp.SimpleRabbitListenerContainerFactoryConfigurer; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.util.ErrorHandler; @@ -49,10 +50,10 @@ public class Application { } @Bean - public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory(ConnectionFactory connectionFactory) { + public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory(ConnectionFactory connectionFactory, + SimpleRabbitListenerContainerFactoryConfigurer configurer) { SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory(); - factory.setConnectionFactory(connectionFactory); - factory.setMessageConverter(jsonConverter()); + configurer.configure(factory, connectionFactory); factory.setErrorHandler(errorHandler()); return factory; } diff --git a/spring-rabbit-global-errorhandler/src/main/resources/application.properties b/spring-rabbit-global-errorhandler/src/main/resources/application.properties deleted file mode 100644 index e69de29..0000000 diff --git a/spring-rabbit-global-errorhandler/src/main/resources/application.yml b/spring-rabbit-global-errorhandler/src/main/resources/application.yml new file mode 100644 index 0000000..930fd9e --- /dev/null +++ b/spring-rabbit-global-errorhandler/src/main/resources/application.yml @@ -0,0 +1,10 @@ +spring: + rabbitmq: + listener: + simple: + retry: + enabled: false + initial-interval: 2000 + multiplier: 1.5 + max-interval: 10000 + max-attempts: 3 diff --git a/spring-rabbit-json/pom.xml b/spring-rabbit-json/pom.xml index 6e00c95..4b3a004 100644 --- a/spring-rabbit-json/pom.xml +++ b/spring-rabbit-json/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.5.RELEASE + 2.0.6.RELEASE