zoukankan      html  css  js  c++  java
  • rabbitMq可靠性投递之手动ACK

    
    
    #手动应答
    #spring.rabbitmq.listener.simple.acknowledge-mode=manual

    #spring.rabbitmq.listener.simple.acknowledge-mode=none
    #不发生异常才应答
    #spring.rabbitmq.listener.simple.acknowledge-mode=auto



    @Component @RabbitListener(queues="first",containerFactory="rabbitListenerContainerFactory" )//使用特定的监听工厂类 public class FirstConsumer { @RabbitHandler public void process(@Payload Tests jsonpObject, Message message, Channel channel) throws IOException { // factory.setAcknowledgeMode(AcknowledgeMode.MANUAL);开启了手动配置后 //处理自己得业务 System.out.println(jsonpObject); // 处理完自己的业务后 手动应答 // 这里需要手动设置消息确认 channel.basicAck(message.getMessageProperties().getDeliveryTag(),false); } }
    一点点学习,一丝丝进步。不懈怠,才不会被时代淘汰
  • 相关阅读:
    saltstack
    python一个命令开启http服务器
    常用服务安装部署
    位置1
    linux中python3安装和使用
    Linux基础系统优化
    Shell基本命令
    linux系统目录结构
    远程连接linux服务器
    VMware和Centos安装使用
  • 原文地址:https://www.cnblogs.com/wangbiaohistory/p/14630870.html
Copyright © 2011-2022 走看看