TL; DR如何以编程方式创建Spring Boot AMQP连接工厂?
嘿,
为了连接到我的RabbitMQ,我将这些添加到我的Spring Boot应用程序的application.properties文件中:
弹簧….
@Bean public ConnectionFactory connectionFactory() { CachingConnectionFactory connectionFactory = new CachingConnectionFactory(); connectionFactory.setAddresses(address); connectionFactory.setUsername(username); connectionFactory.setPassword(password); return connectionFactory; }