diff --git a/helloworld/pom.xml b/helloworld/pom.xml
index 11265d8..08f25af 100644
--- a/helloworld/pom.xml
+++ b/helloworld/pom.xml
@@ -5,7 +5,7 @@
4.0.0
org.springframework.samples.spring
spring-rabbit-helloworld
- 2.4.0-M2
+ 2.4.0-M3
jar
Spring AMQP Hello World
https://www.spring.io
@@ -16,7 +16,7 @@
true
- 2.4.0-M2
+ 2.4.0-M3
UTF-8
1.8
false
diff --git a/log4j2/pom.xml b/log4j2/pom.xml
index 7d16a88..10a785a 100644
--- a/log4j2/pom.xml
+++ b/log4j2/pom.xml
@@ -5,7 +5,7 @@
org.springframework.amqp.samples
log4j2
- 2.4.0-M2
+ 2.4.0-M3
jar
log4j2
@@ -14,7 +14,7 @@
org.springframework.boot
spring-boot-starter-parent
- 2.5.3
+ 2.6.0-M2
@@ -22,7 +22,7 @@
UTF-8
1.8
5.3.0-RC2
- 2.4.0-M2
+ 2.4.0-M3
diff --git a/pom.xml b/pom.xml
index f93697a..17de5f0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
org.springframework.amqp
spring-amqp-samples
Spring AMQP Samples
- 2.4.0-M2
+ 2.4.0-M3
pom
helloworld
diff --git a/spring-rabbit-confirms-returns/pom.xml b/spring-rabbit-confirms-returns/pom.xml
index 6e18615..fc81461 100644
--- a/spring-rabbit-confirms-returns/pom.xml
+++ b/spring-rabbit-confirms-returns/pom.xml
@@ -5,7 +5,7 @@
org.springframework.amqp.samples
spring-rabbit-confirms-returns
- 2.4.0-M2
+ 2.4.0-M3
jar
spring-rabbit-confirms-returns
@@ -14,7 +14,7 @@
org.springframework.boot
spring-boot-starter-parent
- 2.5.3
+ 2.6.0-M2
@@ -22,7 +22,7 @@
UTF-8
UTF-8
1.8
- 2.4.0-M2
+ 2.4.0-M3
diff --git a/spring-rabbit-global-errorhandler/pom.xml b/spring-rabbit-global-errorhandler/pom.xml
index 5c3d2c1..2b4d202 100644
--- a/spring-rabbit-global-errorhandler/pom.xml
+++ b/spring-rabbit-global-errorhandler/pom.xml
@@ -5,7 +5,7 @@
com.example
spring-rabbit-global-errorhandler
- 2.4.0-M2
+ 2.4.0-M3
jar
spring-rabbit-global-errorhandler
@@ -14,7 +14,7 @@
org.springframework.boot
spring-boot-starter-parent
- 2.5.3
+ 2.6.0-M2
@@ -22,7 +22,7 @@
UTF-8
UTF-8
1.8
- 2.4.0-M2
+ 2.4.0-M3
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 e307219..de8100e 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
@@ -12,7 +12,6 @@ import org.springframework.amqp.rabbit.listener.ConditionalRejectingErrorHandler
import org.springframework.amqp.rabbit.support.ListenerExecutionFailedException;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
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;
@@ -29,16 +28,13 @@ public class Application {
public static void main(String[] args) throws Exception {
ConfigurableApplicationContext context = SpringApplication.run(Application.class, args);
- context.getBean(Application.class).runDemo();
+ context.getBean(Application.class).runDemo(context.getBean(RabbitTemplate.class));
context.close();
}
- @Autowired
- private RabbitTemplate template;
-
- private void runDemo() throws Exception {
- this.template.convertAndSend(TEST_QUEUE, new Foo("bar"));
- this.template.convertAndSend(TEST_QUEUE, new Foo("bar"), m -> {
+ private void runDemo(RabbitTemplate template) throws Exception {
+ template.convertAndSend(TEST_QUEUE, new Foo("bar"));
+ template.convertAndSend(TEST_QUEUE, new Foo("bar"), m -> {
return new Message("some bad json".getBytes(), m.getMessageProperties());
});
Thread.sleep(5000);
diff --git a/spring-rabbit-json/pom.xml b/spring-rabbit-json/pom.xml
index b782a05..e2ca3dc 100644
--- a/spring-rabbit-json/pom.xml
+++ b/spring-rabbit-json/pom.xml
@@ -5,7 +5,7 @@
com.example
spring-rabbit-json
- 2.4.0-M2
+ 2.4.0-M3
jar
spring-rabbit-json
@@ -14,7 +14,7 @@
org.springframework.boot
spring-boot-starter-parent
- 2.5.3
+ 2.6.0-M2
@@ -22,7 +22,7 @@
UTF-8
UTF-8
1.8
- 2.4.0-M2
+ 2.4.0-M3
diff --git a/spring-rabbit-json/src/main/java/org/springframework/amqp/samples/json/Application.java b/spring-rabbit-json/src/main/java/org/springframework/amqp/samples/json/Application.java
index b1a3b2a..34a8d6e 100644
--- a/spring-rabbit-json/src/main/java/org/springframework/amqp/samples/json/Application.java
+++ b/spring-rabbit-json/src/main/java/org/springframework/amqp/samples/json/Application.java
@@ -39,22 +39,17 @@ public class Application {
public static void main(String[] args) throws Exception {
ConfigurableApplicationContext ctx = SpringApplication.run(Application.class, args);
- ctx.getBean(Application.class).runDemo();
+ ctx.getBean(Application.class).runDemo(ctx.getBean("rabbitTemplate", RabbitTemplate.class),
+ ctx.getBean("jsonRabbitTemplate", RabbitTemplate.class));
ctx.close();
}
- @Autowired
- private RabbitTemplate rabbitTemplate;
-
- @Autowired
- private RabbitTemplate jsonRabbitTemplate;
-
@Autowired
private AmqpAdmin rabbitAdmin;
private volatile CountDownLatch latch = new CountDownLatch(2);
- public void runDemo() throws Exception {
+ public void runDemo(RabbitTemplate rabbitTemplate, RabbitTemplate jsonRabbitTemplate) throws Exception {
String json = "{\"foo\" : \"value\" }";
Message jsonMessage = MessageBuilder.withBody(json.getBytes())
.andProperties(MessagePropertiesBuilder.newInstance().setContentType("application/json")
@@ -62,19 +57,19 @@ public class Application {
// inferred type
- this.rabbitTemplate.send(INFERRED_FOO_QUEUE, jsonMessage);
- this.rabbitTemplate.send(INFERRED_BAR_QUEUE, jsonMessage);
+ rabbitTemplate.send(INFERRED_FOO_QUEUE, jsonMessage);
+ rabbitTemplate.send(INFERRED_BAR_QUEUE, jsonMessage);
this.latch.await(10, TimeUnit.SECONDS);
// convertAndReceive with type
- this.rabbitTemplate.send(RECEIVE_AND_CONVERT_QUEUE, jsonMessage);
- this.rabbitTemplate.send(RECEIVE_AND_CONVERT_QUEUE, jsonMessage);
+ rabbitTemplate.send(RECEIVE_AND_CONVERT_QUEUE, jsonMessage);
+ rabbitTemplate.send(RECEIVE_AND_CONVERT_QUEUE, jsonMessage);
- Foo foo = this.jsonRabbitTemplate.receiveAndConvert(RECEIVE_AND_CONVERT_QUEUE, 10_000,
+ Foo foo = jsonRabbitTemplate.receiveAndConvert(RECEIVE_AND_CONVERT_QUEUE, 10_000,
new ParameterizedTypeReference() { });
System.out.println("Expected a Foo, got a " + foo);
- Bar bar = this.jsonRabbitTemplate.receiveAndConvert(RECEIVE_AND_CONVERT_QUEUE, 10_000,
+ Bar bar = jsonRabbitTemplate.receiveAndConvert(RECEIVE_AND_CONVERT_QUEUE, 10_000,
new ParameterizedTypeReference() { });
System.out.println("Expected a Bar, got a " + bar);
@@ -82,9 +77,9 @@ public class Application {
this.latch = new CountDownLatch(2);
jsonMessage.getMessageProperties().setHeader("__TypeId__", "foo");
- this.rabbitTemplate.send(MAPPED_QUEUE, jsonMessage);
+ rabbitTemplate.send(MAPPED_QUEUE, jsonMessage);
jsonMessage.getMessageProperties().setHeader("__TypeId__", "bar");
- this.rabbitTemplate.send(MAPPED_QUEUE, jsonMessage);
+ rabbitTemplate.send(MAPPED_QUEUE, jsonMessage);
this.latch.await(10, TimeUnit.SECONDS);
this.rabbitAdmin.deleteQueue(RECEIVE_AND_CONVERT_QUEUE);
diff --git a/stocks/pom.xml b/stocks/pom.xml
index c5a2fff..35e02a5 100644
--- a/stocks/pom.xml
+++ b/stocks/pom.xml
@@ -4,7 +4,7 @@
4.0.0
org.springframework.samples.spring
spring-rabbit-stocks
- 2.4.0-M2
+ 2.4.0-M3
war
Spring Rabbit Stocks
https://www.spring.io
@@ -16,7 +16,7 @@
true
5.3.7
- 2.4.0-M2
+ 2.4.0-M3
UTF-8
1.8
false