类 RocketMQClusterPolicy

java.lang.Object
net.oschina.j2cache.cluster.RocketMQClusterPolicy
所有已实现的接口:
ClusterPolicy, org.apache.rocketmq.client.consumer.listener.MessageListener, org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently

public class RocketMQClusterPolicy extends Object implements ClusterPolicy, org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently
使用 RocketMQ 实现集群内节点的数据通知(用于对数据一致性要求特别严格的场景)
作者:
Winter Lau (javayou@gmail.com)
  • 构造器详细资料

    • RocketMQClusterPolicy

      public RocketMQClusterPolicy(Properties props)
  • 方法详细资料

    • isLocalCommand

      public boolean isLocalCommand(Command cmd)
      从接口复制的说明: ClusterPolicy
      判断是否本地实例的命令
      指定者:
      isLocalCommand 在接口中 ClusterPolicy
      参数:
      cmd - 命令信息
      返回:
      true if the cmd sent by self
    • evict

      public void evict(String region, String... keys)
      删除本地某个缓存条目
      指定者:
      evict 在接口中 ClusterPolicy
      参数:
      region - 区域名称
      keys - 缓存键值
    • clear

      public void clear(String region)
      清除本地整个缓存区域
      指定者:
      clear 在接口中 ClusterPolicy
      参数:
      region - 区域名称
    • connect

      public void connect(Properties props, CacheProviderHolder holder)
      从接口复制的说明: ClusterPolicy
      连接到集群
      指定者:
      connect 在接口中 ClusterPolicy
      参数:
      props - j2cache 配置信息
      holder - Cache Provider Instance
    • publish

      public void publish(Command cmd)
      从接口复制的说明: ClusterPolicy
      发送消息
      指定者:
      publish 在接口中 ClusterPolicy
      参数:
      cmd - command to send
    • consumeMessage

      public org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus consumeMessage(List<org.apache.rocketmq.common.message.MessageExt> list, org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext context)
      指定者:
      consumeMessage 在接口中 org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently
    • disconnect

      public void disconnect()
      从接口复制的说明: ClusterPolicy
      断开集群连接
      指定者:
      disconnect 在接口中 ClusterPolicy