@Autowired
AmqpAdmin amqpAdmin;
@Test
public void test(){
amqpAdmin.declareExchange(new DirectExchange("demo.exchange"));
amqpAdmin.declareQueue(new Queue("demo.queue",true));
amqpAdmin.declareBinding(new Binding("demo.queue",Binding.DestinationType.QUEUE,"demo.exchange","demo.routingKey",null));
}
SpringBoot中创建交换器、队列和绑定关系
最新推荐文章于 2023-08-18 12:31:31 发布