[rabbitmq-discuss] How to Topic Echange configuration using @config annotations in Spring-AMQP?

Gary Russell grussell at gopivotal.com
Tue Sep 3 14:36:12 BST 2013


@Configuration public class Config { @Bean public ConnectionFactory
connectionFactory() { return new CachingConnectionFactory(); } @Bean public
Queue foo() { return new Queue("foo", false); } @Bean public TopicExchange
topic() { return new TopicExchange("footopic"); } @Bean public Binding
binding() { return BindingBuilder.bind(foo()).to(topic()).with("foo.*"); }
@Bean public RabbitAdmin rabbitAdmin() { return new
RabbitAdmin(connectionFactory()); } @Bean public
SimpleMessageListenerContainer container() { SimpleMessageListenerContainer
container = new SimpleMessageListenerContainer(connectionFactory());
MessageListenerAdapter adapter = new MessageListenerAdapter(myListener());
container.setMessageListener(adapter); container.setQueues(foo()); return
container; } @Bean public Object myListener() { return new Foo(); } @Bean
public RabbitTemplate template() { return new
RabbitTemplate(connectionFactory()); } }



On Tue, Sep 3, 2013 at 2:44 AM, Rajasekhar P <sekhar434145 at gmail.com> wrote:

> Hi,
>
> Can anyone please tell me how to write a producer and consumer with Topic
> exchange using @configuration annotation in Spring-AQMP 1.2.
>
> Thanks in advance!!!
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130903/f4840e54/attachment.htm>


More information about the rabbitmq-discuss mailing list