当前位置: 首页>>代码示例>>Java>>正文


Java MessageArrivingListener类代码示例

本文整理汇总了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;
}
 
开发者ID:apache,项目名称:rocketmq,代码行数:39,代码来源:MessageStoreWithFilterTest.java

示例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


注:本文中的org.apache.rocketmq.store.MessageArrivingListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。