rabitMQ

作者: setone | 来源:发表于2018-09-21 11:20 被阅读0次
     @RabbitListener(queuesToDeclare = @Queue("productInfo"))
    

    配置这个注解会在mq里面自动生成一个列队,name为 productInfo,并监听这个列队的消息,mq里面有消息时会在这里被监听到并消费,如果消费者抛异常,就会一直接收到这个消息,直到消费完这条消息

    amqpTemplate.convertAndSend("productInfo","msg");
    

    这个方法会向mq的"productInfo"列队发送消息,发送的信息一般默认处理为base64编码

    相关文章

      网友评论

          本文标题:rabitMQ

          本文链接:https://www.haomeiwen.com/subject/xzdanftx.html