接口 IMQPool

所有超级接口:
AutoCloseable
所有已知实现类:
MQPool

public interface IMQPool extends AutoCloseable
mq 应用池接口
  • 方法详细资料

    • setExceptionHander

      void setExceptionHander(ISubException hander)
      异常回调
      参数:
      hander - hander
    • isOpen

      boolean isOpen()
      Returns true if the connection is still in a state where it can be used. Identical to checking if RabbitMQ.Client.IConnection.CloseReason equal null.
      返回:
      boolean
    • getHeartbeat

      int getHeartbeat()
      The current heartbeat setting for this connection (0 for disabled). second
      返回:
      int
    • exchangeDeclare

      void exchangeDeclare(String exchange, String type, Boolean durable, Boolean autoDelete, Map<String,Object> arguments) throws Exception
      定义交换器
      参数:
      exchange - 交换器, 默认 "amq.direct"
      type - 交换器类型, 默认 "direct"
      durable - 是否持久化, 默认true
      autoDelete - 当已经没有消费者时,服务器是否可以删除该Exchange, 默认 false
      arguments - arguments
      抛出:
      Exception - Exception
    • exchangeDeclare

      void exchangeDeclare(ExchangeConfig config) throws Exception
      定义交换器
      参数:
      config - ExchangeConfig
      抛出:
      Exception - Exception
    • exchangeDeclare

      void exchangeDeclare(List<ExchangeConfig> configs) throws Exception
      批量定义交换器
      参数:
      configs - ExchangeConfig
      抛出:
      Exception - Exception
    • queueDeclare

      void queueDeclare(QueueConfig config) throws Exception
      定义队列
      参数:
      config - QueueConfig
      抛出:
      Exception - Exception
    • queueDeclare

      void queueDeclare(List<QueueConfig> queues) throws Exception
      批量定义队列
      参数:
      queues - QueueConfig
      抛出:
      Exception - Exception
    • pub

      <T> boolean pub(T msg, String routingKey, Integer expire, String exchange, Boolean persistent, Map<String,Object> headers) throws Exception
      发布消息
      类型参数:
      T - T
      参数:
      msg - 消息
      routingKey - routingKey
      expire - 消息过期时间, 秒
      exchange - exchange, 默认 "amq.direct"
      persistent - 消息是否持久化, 默认 false
      headers - headers
      返回:
      boolean
      抛出:
      Exception - Exception
    • pub

      <T> boolean pub(T msg, PubConfig config, Integer expire, Boolean persistent, Map<String,Object> headers) throws Exception
      发布消息
      类型参数:
      T - T
      参数:
      msg - 消息
      config - 路由配置
      expire - 消息过期时间, 秒
      persistent - 消息是否持久化, 默认 false
      headers - headers
      返回:
      boolean
      抛出:
      Exception - Exception
    • pub

      <T> boolean pub(List<T> msgList, String routingKey, Integer expire, String exchange, Boolean persistent, Map<String,Object> headers) throws Exception
      发布消息
      类型参数:
      T - T
      参数:
      msgList - 消息
      routingKey - routingKey
      expire - 消息过期时间, 秒
      exchange - exchange, 默认 "amq.direct"
      persistent - 消息是否持久化, 默认 false
      headers - headers
      返回:
      boolean
      抛出:
      Exception - Exceptions
    • pub

      <T> boolean pub(List<T> msgList, PubConfig config, Integer expire, Boolean persistent, Map<String,Object> headers) throws Exception
      发布消息
      类型参数:
      T - T
      参数:
      msgList - 消息
      config - 路由配置
      expire - 消息过期时间, 秒
      persistent - 消息是否持久化, 默认 false
      headers - headers
      返回:
      boolean
      抛出:
      Exception - Exception
    • pubDelay

      <T> boolean pubDelay(T msg, String delayRoutingKey, Integer delay, String exchange, Boolean persistent, Map<String,Object> headers) throws Exception
      发布延迟消息
      类型参数:
      T - T
      参数:
      msg - 消息
      delayRoutingKey - delayRoutingKey
      delay - 延迟时间, 秒
      exchange - exchange, 默认 "amq.direct"
      persistent - 消息是否持久化, 默认 false
      headers - headers
      返回:
      boolean
      抛出:
      Exception - Exception
    • pubDelay

      <T> boolean pubDelay(T msg, PubConfig config, Integer delay, Boolean persistent, Map<String,Object> headers) throws Exception
      发布延迟消息
      类型参数:
      T - T
      参数:
      msg - 消息
      config - 路由配置
      delay - 延迟时间, 秒
      persistent - 消息是否持久化, 默认 false
      headers - headers
      返回:
      boolean
      抛出:
      Exception - Exception
    • pubDelay

      <T> boolean pubDelay(List<T> msgList, String delayRoutingKey, Integer delay, String exchange, Boolean persistent, Map<String,Object> headers) throws Exception
      发布延迟消息
      类型参数:
      T - T
      参数:
      msgList - 消息
      delayRoutingKey - delayRoutingKey
      delay - 延迟时间, 秒
      exchange - exchange, 默认 "amq.direct"
      persistent - 消息是否持久化, 默认 false
      headers - headers
      返回:
      boolean
      抛出:
      Exception - Exception
    • pubDelay

      <T> boolean pubDelay(List<T> msgList, PubConfig config, Integer delay, Boolean persistent, Map<String,Object> headers) throws Exception
      发布延迟消息
      类型参数:
      T - T
      参数:
      msgList - 消息
      config - 路由配置
      delay - 延迟时间, 秒
      persistent - 消息是否持久化, 默认 false
      headers - headers
      返回:
      boolean
      抛出:
      Exception - Exception
    • sub

      <T> void sub(ISubHander<T> hander, String queue, Boolean autoAck) throws Exception
      消费消息
      类型参数:
      T - T
      参数:
      hander - hander
      queue - queue
      autoAck - 是否自动确认, 默认 false
      抛出:
      Exception - Exception