单元测试举例:
@Autowired
AmqpAdmin amqpAdmin;
@Test
public void createExchange(){
//创建Exchange
Exchange exchange=new DirectExchange("amqpadmin.exchangete");
amqpAdmin.declareExchange(exchange);
System.out.println("创建完成");
//创建Queue
amqpAdmin.declareQueue(new Queue("amqpadmin.queue",true));
//创建绑定规则
amqpAdmin.declareBinding(new Binding("amqpadmin.queue",Binding.DestinationType.QUEUE,"amqpadmin.exchangete","amqpadmin.test",null));
}