类 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)
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void清除本地整个缓存区域voidconnect(Properties props, CacheProviderHolder holder) 连接到集群org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatusconsumeMessage(List<org.apache.rocketmq.common.message.MessageExt> list, org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext context) void断开集群连接void删除本地某个缓存条目booleanisLocalCommand(Command cmd) 判断是否本地实例的命令void发送消息从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 net.oschina.j2cache.cluster.ClusterPolicy
handleCommand, sendClearCmd, sendEvictCmd
-
构造器详细资料
-
RocketMQClusterPolicy
-
-
方法详细资料
-
isLocalCommand
从接口复制的说明:ClusterPolicy判断是否本地实例的命令- 指定者:
isLocalCommand在接口中ClusterPolicy- 参数:
cmd- 命令信息- 返回:
- true if the cmd sent by self
-
evict
删除本地某个缓存条目- 指定者:
evict在接口中ClusterPolicy- 参数:
region- 区域名称keys- 缓存键值
-
clear
清除本地整个缓存区域- 指定者:
clear在接口中ClusterPolicy- 参数:
region- 区域名称
-
connect
从接口复制的说明:ClusterPolicy连接到集群- 指定者:
connect在接口中ClusterPolicy- 参数:
props- j2cache 配置信息holder- Cache Provider Instance
-
publish
从接口复制的说明: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
-