adyliu / jafka

a fast and simple distributed publish-subscribe messaging system (mq)

Home Page:https://github.com/adyliu/jafka/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jafka#start(Properties, Properties, Properties) 方法判断有误

ykgarfield opened this issue · comments

此方法如下:

public void start(Properties mainProperties, Properties consumerProperties, Properties producerProperties) {
        final ServerConfig config = new ServerConfig(mainProperties);
        final ConsumerConfig consumerConfig = consumerProperties == null ? null : new ConsumerConfig(consumerProperties);
        final ProducerConfig producerConfig = consumerConfig == null ? null : new ProducerConfig(producerProperties);
        start(config, consumerConfig, producerConfig);
}

ProducerConfig producerConfig ... 这行代码判断是否有误,应该是:

final ProducerConfig producerConfig = producerProperties == null ? null : new ProducerConfig(producerProperties);

是否应该是判断 producerProperties == null 而不是 consumerConfig == null.

没问题。

这段代码的意思是 如果需要消费消息,那么消费的消息需要重新以Producer的方式发送出去。
其实是镜像拷贝功能。