jafka icon indicating copy to clipboard operation
jafka copied to clipboard

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

Open ykgarfield opened this issue 9 years ago • 1 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.

ykgarfield avatar Sep 19 '16 03:09 ykgarfield

没问题。

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

adyliu avatar Sep 19 '16 12:09 adyliu