forked from Farfetch/kafkaflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added support for consumer strategies that do not act as "stop the …
…world" scenarios (e.g., cooperative sticky). Fixes issue Farfetch#557 and Fixes issue Farfetch#456 * Enabled automatic committing with `confluent auto commit: true` instead of relying solely on manual commits, but only when the consumer strategy is cooperative sticky. (Refer to the open librdkafka issue at confluentinc/librdkafka#4059).
- Loading branch information
Showing
4 changed files
with
112 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Confluent.Kafka; | ||
|
||
namespace KafkaFlow.Extensions; | ||
|
||
/// <summary> | ||
/// Strategy extension methods. | ||
/// </summary> | ||
public static class StrategyExtensions | ||
{ | ||
/// <summary> | ||
/// Determine if the strategy is a "stop the world" behavior. | ||
/// </summary> | ||
/// <param name="strategy">Strategy</param> | ||
/// <returns></returns> | ||
public static bool IsStopTheWorldStrategy(this PartitionAssignmentStrategy? strategy) => | ||
strategy is null or PartitionAssignmentStrategy.Range or PartitionAssignmentStrategy.RoundRobin; | ||
} |