Change use of RabbitTemplate to AmqpTemplate.
Javadoc cleanup
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.springframework.amqp.helloworld;
|
||||
|
||||
import org.springframework.amqp.core.AmqpTemplate;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
@@ -8,8 +9,8 @@ public class Consumer {
|
||||
|
||||
public static void main(String[] args) {
|
||||
ApplicationContext context = new AnnotationConfigApplicationContext(RabbitConfiguration.class);
|
||||
RabbitTemplate rabbitTemplate = context.getBean(RabbitTemplate.class);
|
||||
System.out.println("Received: " + rabbitTemplate.receiveAndConvert());
|
||||
AmqpTemplate amqpTemplate = context.getBean(AmqpTemplate.class);
|
||||
System.out.println("Received: " + amqpTemplate.receiveAndConvert());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.springframework.amqp.helloworld;
|
||||
|
||||
import org.springframework.amqp.core.AmqpTemplate;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
@@ -8,8 +9,8 @@ public class Producer {
|
||||
|
||||
public static void main(String[] args) {
|
||||
ApplicationContext context = new AnnotationConfigApplicationContext(RabbitConfiguration.class);
|
||||
RabbitTemplate rabbitTemplate = context.getBean(RabbitTemplate.class);
|
||||
rabbitTemplate.convertAndSend("Hello World");
|
||||
AmqpTemplate amqpTemplate = context.getBean(AmqpTemplate.class);
|
||||
amqpTemplate.convertAndSend("Hello World");
|
||||
System.out.println("Sent: Hello World");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user