Package org.jamescarr.amqp.example

Source Code of org.jamescarr.amqp.example.StockProcessorConfiguration

package org.jamescarr.amqp.example;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor;

@Configuration
public class StockProcessorConfiguration extends CommonConfiguration{
  @Bean
  public SimpleMessageListenerContainer listenerContainer() {
    SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
    container.setConnectionFactory(connectionFactory());
    container.setQueueName(this.queueName);
    return container;
  }
  @Bean
  public StockLookup stockLookup(){
    RabbitTemplate template = new RabbitTemplate(connectionFactory());
    template.setRoutingKey("key.b.a");
    template.setExchange(exchange);
   
    StockLookup lookup = new StockLookup();
    lookup.setRabbitTemplate(template);
    return lookup;
  }
 
 
}
TOP

Related Classes of org.jamescarr.amqp.example.StockProcessorConfiguration

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.