1 Aralık 2020 Salı

SpringBoot Amqp DirectRabbitListenerContainerFactory Sınıfı

setConnectionFactory metodu
Şöyle yaparız
@Bean
public CachingConnectionFactory cachingConnectionFactory(){
  CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory();
  cachingConnectionFactory.setAddresses("10.10.121.199:35682");
  cachingConnectionFactory.setUsername("guest");
  cachingConnectionFactory.setPassword("guest");
  return cachingConnectionFactory;
}

@Bean
public DirectRabbitListenerContainerFactory directFactory(ConnectionFactory cf) {
  DirectRabbitListenerContainerFactory factory = new DirectRabbitListenerContainerFactory();
  factory.setConnectionFactory(cf);
  return factory;
}

Hiç yorum yok:

Yorum Gönder