<div dir="ltr"><div><span style="white-space:pre">@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());
        }
}
<br></span></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Sep 3, 2013 at 2:44 AM, Rajasekhar P <span dir="ltr"><<a href="mailto:sekhar434145@gmail.com" target="_blank">sekhar434145@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>Can anyone please tell me how to write a producer and consumer with Topic exchange using @configuration annotation in Spring-AQMP 1.2.</div>
<div><br></div><div>Thanks in advance!!!</div>
</div>
<br>_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
<br></blockquote></div><br></div>