本文整理汇总了Java中org.apache.rocketmq.store.MessageArrivingListener类的典型用法代码示例。如果您正苦于以下问题:Java MessageArrivingListener类的具体用法?Java MessageArrivingListener怎么用?Java MessageArrivingListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MessageArrivingListener类属于org.apache.rocketmq.store包,在下文中一共展示了MessageArrivingListener类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MessageStorePluginContext
import org.apache.rocketmq.store.MessageArrivingListener; //导入依赖的package包/类
public MessageStorePluginContext(MessageStoreConfig messageStoreConfig,
BrokerStatsManager brokerStatsManager, MessageArrivingListener messageArrivingListener,
BrokerConfig brokerConfig) {
super();
this.messageStoreConfig = messageStoreConfig;
this.brokerStatsManager = brokerStatsManager;
this.messageArrivingListener = messageArrivingListener;
this.brokerConfig = brokerConfig;
}
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:10,代码来源:MessageStorePluginContext.java
示例2: gen
import org.apache.rocketmq.store.MessageArrivingListener; //导入依赖的package包/类
protected DefaultMessageStore gen(ConsumerFilterManager filterManager) throws Exception {
MessageStoreConfig messageStoreConfig = buildStoreConfig(
commitLogFileSize, cqFileSize, true, cqExtFileSize
);
BrokerConfig brokerConfig = new BrokerConfig();
brokerConfig.setEnableCalcFilterBitMap(true);
brokerConfig.setMaxErrorRateOfBloomFilter(20);
brokerConfig.setExpectConsumerNumUseFilter(64);
DefaultMessageStore master = new DefaultMessageStore(
messageStoreConfig,
new BrokerStatsManager(brokerConfig.getBrokerClusterName()),
new MessageArrivingListener() {
@Override
public void arriving(String topic, int queueId, long logicOffset, long tagsCode,
long msgStoreTime, byte[] filterBitMap, Map<String, String> properties) {
}
}
, brokerConfig);
master.getDispatcherList().addFirst(new CommitLogDispatcher() {
@Override
public void dispatch(DispatchRequest request) {
try {
} catch (Throwable e) {
e.printStackTrace();
}
}
});
master.getDispatcherList().addFirst(new CommitLogDispatcherCalcBitMap(brokerConfig, filterManager));
assertThat(master.load()).isTrue();
master.start();
return master;
}
示例3: getMessageArrivingListener
import org.apache.rocketmq.store.MessageArrivingListener; //导入依赖的package包/类
public MessageArrivingListener getMessageArrivingListener() {
return messageArrivingListener;
}
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:4,代码来源:MessageStorePluginContext.java
示例4: gen
import org.apache.rocketmq.store.MessageArrivingListener; //导入依赖的package包/类
protected DefaultMessageStore gen(ConsumerFilterManager filterManager) throws Exception {
MessageStoreConfig messageStoreConfig = buildStoreConfig(
commitLogFileSize, cqFileSize, true, cqExtFileSize
);
BrokerConfig brokerConfig = new BrokerConfig();
brokerConfig.setEnableCalcFilterBitMap(true);
brokerConfig.setMaxErrorRateOfBloomFilter(20);
brokerConfig.setExpectConsumerNumUseFilter(64);
DefaultMessageStore master = new DefaultMessageStore(
messageStoreConfig,
new BrokerStatsManager(brokerConfig.getBrokerClusterName()),
new MessageArrivingListener() {
@Override
public void arriving(String topic, int queueId, long logicOffset, long tagsCode,
long msgStoreTime, byte[] filterBitMap, Map<String, String> properties) {
// System.out.println(String.format("Msg coming: %s, %d, %d, %d",
// topic, queueId, logicOffset, tagsCode));
}
}
, brokerConfig);
master.getDispatcherList().addFirst(new CommitLogDispatcher() {
@Override
public void dispatch(DispatchRequest request) {
try {
// System.out.println(String.format("offset:%d, bitMap:%s", request.getCommitLogOffset(),
// BitsArray.create(request.getBitMap()).toString()));
} catch (Throwable e) {
e.printStackTrace();
}
}
});
master.getDispatcherList().addFirst(new CommitLogDispatcherCalcBitMap(brokerConfig, filterManager));
assertThat(master.load()).isTrue();
master.start();
return master;
}
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:43,代码来源:MessageStoreWithFilterTest.java