karate-kafka icon indicating copy to clipboard operation
karate-kafka copied to clipboard

Consumer group.id should not be set

Open loicmathieu opened this issue 4 years ago • 3 comments

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 avatar Dec 16 '20 16:12 loicmathieu

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.

loicmathieu avatar Dec 16 '20 17:12 loicmathieu

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 .

Sdaas avatar Dec 23 '20 12:12 Sdaas

I can provide a PR if you want

loicmathieu avatar Dec 23 '20 12:12 loicmathieu