mq连接配置

Springboot整合RabbitMq

mq配置类,声明队列信息

Springboot整合RabbitMq

生产者

@RequestMapping(value="testFeign",method=RequestMethod.GET)
    public String testFeign(@RequestParam Integer a, @RequestParam Integer b){
        UserInfo userInfo = new UserInfo();
        userInfo.setUserName("lizh");
        userInfo.setPassWord("123");
        byte[] user = DefaultCodecImpl.serialize(userInfo);//对象序列化
        for (int i = 0; i < 9; i++) {
            rabbitTemplate.convertAndSend("user",user);
        }
        return serviceAFeign.add(a,b);
    }

Springboot整合RabbitMq

消费者

Springboot整合RabbitMq

相关文章:

  • 2021-04-04
  • 2021-09-13
  • 2021-08-02
  • 2021-06-08
  • 2021-07-22
猜你喜欢
  • 2022-12-23
  • 2021-05-10
  • 2021-09-03
  • 2021-07-16
  • 2021-10-24
  • 2021-11-13
相关资源
相似解决方案