-
Bug
-
Resolution: Done
-
Undefined
-
None
-
None
-
None
-
None
-
False
-
-
False
-
-
The YAML examples (see here) provide a very bad user experience. They do not set STRIMZI_MESSAGE_COUNT. So it defaults to sending or receiving 10 messages. Once they reach the number:
- The producer completes. But since it is deployed as Deployment, it will be restarted. So it is essentially crash-looping. While it is actually as designed in the code, everyone seeing it would assume it does not work. This needs to be fixed.
- The consumer seems to delete the consumer. But it actually keeps running. This makes it even weirder since the Pod runs but doesn't do anything at all. This is again very bad user experience.
Additionally, the message counting in the consumer seems to be badly designed. It checks if the given number of messages was received with equals (this.messageReceived == this.config.getMessageCount()). But the Kafka poll method can return multiple records and might increase the number of received messages by more then one message. As a result, the desired number of messages might be never reached. If we decide to keep this, we should fix this to check the number of messages with greater-than.
Overall, I think the right thing to do would be to remove the message count completely. It seems to be useless to me - I would prefer the pods to run and work constantly. But if we want to keep it, we need to make the example more usable. For example:
- Set the message count to some much higher number (millions) to not have it stop
- Use Job instead of Deployment or disable restarting to avoid the crash loops
- Fix the message counting in the consumer
Created by ClientExamples#117