code-not-found / spring-kafka

spring-kafka projects
https://www.codenotfound.com/spring-kafka
MIT License
229 stars 419 forks source link

ERROR o.a.zookeeper.server.ZooKeeperServer - ZKShutdownHandler is not registered, so ZooKeeper server won't take any action on ERROR or SHUTDOWN server state changes #2

Closed pi408637535 closed 6 years ago

pi408637535 commented 7 years ago

log:

. _ _ /\ / '_ () \ \ \ \ ( ( )\ | ' | '| | ' \/ ` | \ \ \ \ \/ _)| |)| | | | | || (| | ) ) ) ) ' |__| .|| ||| |\, | / / / / =========|_|==============|__/=//// :: Spring Boot :: (v1.5.4.RELEASE)

16:08:04.256 [main] INFO c.c.kafka.SpringKafkaApplicationTest - Starting SpringKafkaApplicationTest on 55-PC with PID 3796 (started by 55 in D:\Github Code\spring-kafka-master\spring-kafka-multiple-topics) 16:08:04.257 [main] INFO c.c.kafka.SpringKafkaApplicationTest - No active profile set, falling back to default profiles: default 16:08:08.073 [main] INFO c.c.kafka.SpringKafkaApplicationTest - Started SpringKafkaApplicationTest in 4.392 seconds (JVM running for 9.06) 16:08:10.343 [main] INFO c.codenotfound.kafka.producer.Sender - sending payload='Bar [bar=bar]' to topic='spark' 16:08:10.427 [main] INFO c.codenotfound.kafka.producer.Sender - sending payload='Foo [foo=foo]' to topic='stockPrice' 16:08:10.492 [org.springframework.kafka.KafkaListenerEndpointContainer#1-0-C-1] INFO c.c.kafka.consumer.Receiver - received Foo [foo=foo] 16:08:10.492 [org.springframework.kafka.KafkaListenerEndpointContainer#0-0-C-1] INFO c.c.kafka.consumer.Receiver - received Bar [bar=bar] 16:08:10.492 [main] INFO c.c.kafka.consumer.Receiver - received Bar [bar=null] 16:08:10.492 [main] INFO c.c.kafka.consumer.Receiver - received Foo [foo=null] 16:08:12.107 [main] ERROR o.a.zookeeper.server.ZooKeeperServer - ZKShutdownHandler is not registered, so ZooKeeper server won't take any action on ERROR or SHUTDOWN server state changes 16:08:12.130 [NIOServerCxn.Factory:/127.0.0.1:0] WARN o.a.zookeeper.server.NIOServerCnxn - caught end of stream exception org.apache.zookeeper.server.ServerCnxn$EndOfStreamException: Unable to read additional data from client sessionid 0x15e65ae64720000, likely client has closed socket at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:228) at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:203) at java.lang.Thread.run(Thread.java:748)

Process finished with exit code 0

this is my code: @Test public void testReceive() throws Exception { sender.send(BAR_TOPIC, new Bar("bar")); sender.send(FOO_TOPIC, new Foo("foo"));

receiver.getLatch().await(10000, TimeUnit.MILLISECONDS);
receiver.receiveBar(new Bar());
receiver.receiveFoo(new Foo());

// assertThat(receiver.getLatch().getCount()).isEqualTo(0); }

I confuse this error.(note: why don't I need to configure zk? why don't I need to configure consumer group.id)

code-not-found commented 7 years ago

Hi,

If you are referring to the "ZKShutdownHandler is not registered" error then you can ignore this as the level of this log statement is probably to high (for more information checkout this thread: https://issues.apache.org/jira/browse/ZOOKEEPER-2795).

The group.id (GROUP_ID_CONFIG) is configured in the ReceiverConfig class.

Let me know if this answers the question.