Sdaas / karate-kafka

Using KarateDSL to test Kafka applications
MIT License
32 stars 18 forks source link

Consumer group.id should not be set #4

Open loicmathieu opened 3 years ago

loicmathieu commented 3 years ago

Consumer group.id should not be set by default. When you launch a scenario a first with a consumer group set via group.id Kafka will register the offset read by this consumer group. If you launch the same scenario some times later, Kafka will send you all the messages sent between the two launch of the scenario.

This is usually not what to do for a end to end test perspective when you're only interested on the messages send during your scenario.

So I propose to not set consumer group.id by default.

loicmathieu commented 3 years ago

In fact, you must se group.id to avoid commiting offset on a topic enable.auto.commit should be set to false by default. This will allow to have idempotent scenario.

Sdaas commented 3 years ago

Consumer group.id should not be set by default. When you launch a scenario a first with a consumer group set via group.id Kafka will register the offset read by this consumer group. If you launch the same scenario some times later, Kafka will send you all the messages sent between the two launch of the scenario.

This is usually not what to do for a end to end test perspective when you're only interested on the messages send during your scenario.

So I propose to not set consumer group.id by default.

Good point. Thanks for the feedback .

loicmathieu commented 3 years ago

I can provide a PR if you want