Hazelcast主题订单发布每个100K事件

时间:2016-04-05 08:45:56

标签: java hazelcast

我正在检查具有不同数量的主题发布者和订阅者的hazelcast群集的吞吐量。 有2个发布者和2个订阅者一切正常。 有3个发布商和1个订阅者,我发现订单问题: 每个发布商的每100K事件我的订单不匹配2-10个事件。 Hazelcast版本:3.6.1

这是我的配置:

@Bean
public HazelcastInstance hazelcastInstance() {
    Config config = new Config();
    config.getGroupConfig().setName("test").setPassword("test");
    config.setTopicConfigs(getTopicConfigs());
    return Hazelcast.newHazelcastInstance(config);
}

private Map<String, TopicConfig> getTopicConfigs() {
    TopicConfig topicConfig = new TopicConfig(topicName);
    topicConfig.setStatisticsEnabled(false);
    return new HashMap<String, TopicConfig>(){{put(topicName,topicConfig);}};
}

@Profile("out")
@Bean
public ITopic<Event> eventsOutput(HazelcastInstance hazelcastInstance) {
    return hazelcastInstance.getTopic("events");
}

@Profile("in")
@Bean
public ITopic<Event> eventsInput(HazelcastInstance hazelcastInstance) {
    return hazelcastInstance.getTopic("events");
}

以下是日志的一部分:

Not matched for publisher1, seq numbers: (current) 200001 != 200000 (expected)
Not matched for publisher1, seq numbers: (current) 200002 != 200001 (expected)
Not matched for publisher1, seq numbers: (current) 200003 != 200002 (expected)
Not matched for publisher1, seq numbers: (current) 200000 != 200003 (expected)

Not matched for publisher1, seq numbers: (current) 300001 != 300000 (expected)
Not matched for publisher1, seq numbers: (current) 300002 != 300001 (expected)
Not matched for publisher1, seq numbers: (current) 300003 != 300002 (expected)
Not matched for publisher1, seq numbers: (current) 300004 != 300003 (expected)
Not matched for publisher1, seq numbers: (current) 300005 != 300004 (expected)
Not matched for publisher1, seq numbers: (current) 300006 != 300005 (expected)
Not matched for publisher1, seq numbers: (current) 300000 != 300006 (expected)

Not matched for publisher3, seq numbers: (current) 100001 != 100000 (expected)
Not matched for publisher3, seq numbers: (current) 100002 != 100001 (expected)
Not matched for publisher3, seq numbers: (current) 100003 != 100002 (expected)
Not matched for publisher3, seq numbers: (current) 100000 != 100003 (expected)

Not matched for publisher2, seq numbers: (current) 500001 != 500000 (expected)
Not matched for publisher2, seq numbers: (current) 500000 != 500001 (expected)

Not matched for publisher1, seq numbers: (current) 400001 != 400000 (expected)
Not matched for publisher1, seq numbers: (current) 400002 != 400001 (expected)
Not matched for publisher1, seq numbers: (current) 400000 != 400002 (expected)

等...

我可以认为问题出在我的代码中。但是: - 测试代码非常简单,无需任何额外的过程 - 订单不匹配的seq数量非常漂亮且可重复 - 只有当出版商数量从2增加到3时才会重现。

所以我想问题是使用hazelcast配置。看起来我错过了什么。我正在重读hazelcast规范,尝试了一些属性但没有成功。 有人可以提示一下这个问题可能是什么来源?

会欣赏任何笔记。提前致谢。

0 个答案:

没有答案