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

相关文章:

  • 2019-11-29
  • 2021-12-09
  • 2021-12-07
  • 2018-08-30
  • 2021-10-22
  • 2021-09-08
  • 2020-11-15
  • 2021-10-17
猜你喜欢
  • 2017-12-11
  • 2021-11-15
  • 2021-06-24
  • 2021-05-15
  • 2021-07-10
  • 2019-08-01
  • 2021-07-24
  • 2021-04-17
相关资源
相似解决方案