类 RabbitMQConsumer

java.lang.Object
com.sh.wf.mq.rabbitmq.RabbitMQBase
com.sh.wf.mq.rabbitmq.RabbitMQConsumer

public class RabbitMQConsumer extends RabbitMQBase

Description:

Title:首亨软件 - 聚天平台

从以下版本开始:
2018年12月17日
  • 构造器详细资料

    • RabbitMQConsumer

      public RabbitMQConsumer()
    • RabbitMQConsumer

      public RabbitMQConsumer(String exchange)
    • RabbitMQConsumer

      public RabbitMQConsumer(String connType, String exchange)
  • 方法详细资料

    • getInstance

      public static RabbitMQConsumer getInstance()
    • getInstance

      public static RabbitMQConsumer getInstance(String exchange)
    • getInstance

      public static RabbitMQConsumer getInstance(String connType, String exchange)
    • setConnType

      public RabbitMQConsumer setConnType(String connType)
      覆盖:
      setConnType 在类中 RabbitMQBase
    • subscribe

      public boolean subscribe(RabbitMQCallBack callback)
      订阅普通发布模式
      参数:
      callback - RabbitMQCallBack
      返回:
      boolean
    • subscribe

      public boolean subscribe(RabbitMQCallBack callback, boolean durable, String queueName)
      订阅普通发布模式
      参数:
      callback - 收到消息监听回调
      durable - 是否保存
      queueName - 队列名称,如果需要离线消息,则必须指定固定的队列
      返回:
      boolean
    • subscribe

      public boolean subscribe(RabbitMQCallBack callback, boolean durable)
    • subscribeDelay

      public boolean subscribeDelay(RabbitMQCallBack callback, boolean durable, String queueName)
      订阅普通发布模式
      参数:
      callback - 收到消息监听回调
      durable - 是否保存
      queueName - 队列名称,如果需要离线消息,则必须指定固定的队列
      返回:
      boolean
    • subscribeRoute

      public boolean subscribeRoute(RabbitMQCallBack callback, String[] routeKey)
      订阅路由模式
      参数:
      callback - 收到消息监听回调
      routeKey - 接收路由值
      返回:
      boolean
    • subscribeRoute

      public boolean subscribeRoute(RabbitMQCallBack callback, String[] routeKey, boolean durable, String queueName)
      订阅路由模式
      参数:
      callback - 收到消息监听回调
      routeKey - 接收路由值
      durable - 是否保存
      queueName - 队列名称,如果需要离线消息,则必须指定固定的队列
      返回:
      boolean
    • subscribeTopic

      public boolean subscribeTopic(RabbitMQCallBack callback, String[] routeKey)
      订阅路由模式
      参数:
      callback - 收到消息监听回调
      routeKey - * 匹配后一个词 # 匹配后多个词
      返回:
      boolean
    • subscribeTopic

      public boolean subscribeTopic(RabbitMQCallBack callback, String[] routeKey, boolean durable, String queueName)
      订阅路由模式
      参数:
      callback - 收到消息监听回调
      routeKey - * 匹配后一个词 # 匹配后多个词
      durable - 是否保存
      queueName - 队列名称,如果需要离线消息,则必须指定固定的队列
      返回:
      boolean
    • getMessageCount

      public int getMessageCount(String type, String queueName, boolean durable)
      获取消息队列中的消息数
      参数:
      type - 交换机类型 fanout 或 direct
      queueName - 队列名称
      返回:
      boolean
    • getMessageCountSecurity

      public int getMessageCountSecurity(String type, String queueName, boolean durable)
      获取消息队列的消息数
      参数:
      type -
      queueName -
      durable -
      返回: