Fix config before RC1
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package org.springframework.amqp.helloworld;
|
||||
|
||||
import org.springframework.amqp.core.AmqpAdmin;
|
||||
import org.springframework.amqp.core.Queue;
|
||||
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
|
||||
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
||||
import org.springframework.amqp.rabbit.core.RabbitAdmin;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -19,7 +21,13 @@ public class HelloWorldConfiguration {
|
||||
connectionFactory.setPassword("guest");
|
||||
return connectionFactory;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AmqpAdmin amqpAdmin() {
|
||||
return new RabbitAdmin(connectionFactory());
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RabbitTemplate rabbitTemplate() {
|
||||
RabbitTemplate template = new RabbitTemplate(connectionFactory());
|
||||
//The routing key is set to the name of the queue by the broker for the default exchange.
|
||||
|
||||
@@ -17,6 +17,7 @@ public class ProducerConfiguration {
|
||||
|
||||
protected final String helloWorldQueueName = "hello.world.queue";
|
||||
|
||||
@Bean
|
||||
public RabbitTemplate rabbitTemplate() {
|
||||
RabbitTemplate template = new RabbitTemplate(connectionFactory());
|
||||
template.setRoutingKey(this.helloWorldQueueName);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit.xsd
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
|
||||
|
||||
<bean id="connectionFactory" class="org.springframework.amqp.rabbit.connection.SingleConnectionFactory">
|
||||
<bean id="connectionFactory" class="org.springframework.amqp.rabbit.connection.CachingConnectionFactory">
|
||||
<constructor-arg value="localhost"/>
|
||||
<property name="username" value="guest"/>
|
||||
<property name="password" value="guest"/>
|
||||
|
||||
Reference in New Issue
Block a user