RabbitMq——direct交换器、fanout交换器、 topic交换器

direct交换器:

@Configuration
=发送=
@Bean
protected Queue queue(){
    Queue queue = new Queue(“myQueue”)
    return queue;
}
amqpTemplate.convertAndSend("myQueue","这是发送的内容"); 发送RabbitMq
发送成功

=接收=消费者(新项目)
@Conponent
@RabbitListener(queues=“myQueue”)注解某个方法为接收消息方法
public void Demo(String message){
}
@Conponent
  (queues=“myQueue”)注解某个方法为接收消息方法
public void Demo2(String message){
}

fanout交换器 扇形交换器:
@Configuration
=发送=
@Bean
protected Queue createQueue1(){
    Queue queue = new Queue(“myfanout1”)
    return queue;
}
@Bean
protected Queue createQu

相关推荐

  1. RabbitMq——direct交换器fanout交换器 扇形交换器

    2024-03-18 08:50:02       41 阅读
  2. -交换机-

    2024-03-18 08:50:02       65 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-18 08:50:02       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-18 08:50:02       106 阅读
  3. 在Django里面运行非项目文件

    2024-03-18 08:50:02       87 阅读
  4. Python语言-面向对象

    2024-03-18 08:50:02       96 阅读

热门阅读

  1. 【数据库】MySQL数据库基础

    2024-03-18 08:50:02       43 阅读
  2. 如何在MATLAB中进行循环和条件语句?

    2024-03-18 08:50:02       41 阅读
  3. Vue-- 实现简单版 vue-router

    2024-03-18 08:50:02       41 阅读
  4. C语言中大小写字母是如何转化的?

    2024-03-18 08:50:02       47 阅读
  5. Euler angles and Quaterean

    2024-03-18 08:50:02       39 阅读
  6. Leetcode 第388场周赛 问题和解法

    2024-03-18 08:50:02       42 阅读
  7. Redis 的数据类型及使用场景

    2024-03-18 08:50:02       38 阅读
  8. PyTorch学习笔记之激活函数篇(六)

    2024-03-18 08:50:02       37 阅读
  9. redis常见面试题

    2024-03-18 08:50:02       40 阅读
  10. Bean的实例化方式

    2024-03-18 08:50:02       39 阅读