spring boot 使用RabbitMQ
创建Exchange
1 | amqpAdmin.declareExchange(new DirectExchange("kagarise.exchange")); |
创建队列
1 | amqpAdmin.declareQueue(new Queue("kagarise.queue", true)); |
绑定
1 | amqpAdmin.declareBinding(new Binding("kagarise.queue", Binding.DestinationType.QUEUE, "kagarise.exchange", "kagarise.news", null)); |
Application
1 | // 全局添加 |
Service
1 | // 消息队列名 |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.