AMQP-131: copy config from old base class

This commit is contained in:
Dave Syer
2011-03-28 13:50:55 +01:00
parent c17f4b9d85
commit ef81d17625
4 changed files with 15 additions and 16 deletions

View File

@@ -1,7 +1,6 @@
package org.springframework.amqp.helloworld;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.config.AbstractRabbitConfiguration;
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
@@ -9,7 +8,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class HelloWorldConfiguration extends AbstractRabbitConfiguration {
public class HelloWorldConfiguration {
protected final String helloWorldQueueName = "hello.world.queue";
@@ -21,7 +20,6 @@ public class HelloWorldConfiguration extends AbstractRabbitConfiguration {
return connectionFactory;
}
@Override
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.

View File

@@ -2,7 +2,6 @@ package org.springframework.amqp.helloworld.async;
import java.util.concurrent.atomic.AtomicInteger;
import org.springframework.amqp.rabbit.config.AbstractRabbitConfiguration;
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
@@ -14,11 +13,10 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor;
@Configuration
public class ProducerConfiguration extends AbstractRabbitConfiguration {
public class ProducerConfiguration {
protected final String helloWorldQueueName = "hello.world.queue";
@Override
public RabbitTemplate rabbitTemplate() {
RabbitTemplate template = new RabbitTemplate(connectionFactory());
template.setRoutingKey(this.helloWorldQueueName);