rabbitmq
逆势生长
无法将我毁灭,则必将使我强大
展开
-
springboot 实现 RabbitMq 主题模式(Topic) 案列
目录1.先加入maven依赖2. 在 application.yml 中配置rabbitmq的 连接信息:3.创建生产者4.创建两个消费者5.测试类中测试结果 :控制台打印出消费者的log日志:可见,消费者1 绑定交换机的路由键为 key = "hello.queue.1" ,因此消费了5条奇数类型的消息; 消费者2 绑定交换机的路由键为 key = "hello.queue.*" ,两种都可以匹配上,因此消费了所有消息;1.先加入maven依赖...原创 2020-06-23 14:32:11 · 657 阅读 · 0 评论 -
springboot 实现 RabbitMq 路由模式(Routing) 案列
1.先加入maven依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-amqp</artifactId> </dependency>2. 在 application.yml 中配置rabbitmq的 连接信息...原创 2020-06-23 13:42:08 · 495 阅读 · 3 评论 -
springboot 实现 RabbitMq 订阅发布模式(Publish/Subscribe) 案列
目录1.先加入maven依赖2. 在 application.yml 中配置rabbitmq的 连接信息:3.创建生产者4.创建两个消费者6.测试类中测试结果 :控制台打印出消费者的log日志:可见,两个消费者都收到了生产者发的5条消息1.先加入maven依赖 <dependency> <groupId>org.springframework.boot</groupId> .原创 2020-06-23 11:18:01 · 1053 阅读 · 0 评论 -
springboot 实现 RabbitMq 简单模式 案列
springboot 中使用 rabbitmq简单模式 只需要几点简单配置即可;目录springboot 中使用 rabbitmq简单模式 只需要几点简单配置即可;1.先加入maven依赖2. 在 application.yml 中配置rabbitmq的 连接信息:3.队列配置,启动时创建队列4.创建生产者5.创建消费者6.测试类中测试结果 :控制台打印出消费者的log日志:receiver:rabbit-mq-test1.先加入ma...原创 2020-06-22 19:59:34 · 483 阅读 · 0 评论 -
springboot 实现 RabbitMq 工作模式(Work queues) 案列
1.先加入maven依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-amqp</artifactId> </dependency>2. 在 application.yml 中配置rabbitmq的 连接...原创 2020-06-22 23:03:52 · 1486 阅读 · 1 评论