Skip to content

Commit

Permalink
set the kafka group id to make sure we get our onw read offset in the…
Browse files Browse the repository at this point in the history
… broker.
  • Loading branch information
barnstee committed Nov 25, 2022
1 parent af42d33 commit 5810164
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions KafkaSubscriber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,8 @@ public void Connect()
// create Kafka client
var conf = new ConsumerConfig
{
GroupId = "consumer-group",
GroupId = Environment.GetEnvironmentVariable("CLIENT_NAME"),
BootstrapServers = Environment.GetEnvironmentVariable("BROKER_NAME") + ":" + Environment.GetEnvironmentVariable("BROKER_PORT"),
// Note: The AutoOffsetReset property determines the start offset in the event
// there are not yet any committed offsets for the consumer group for the
// topic/partitions of interest. By default, offsets are committed
// automatically, so in this example, consumption will only start from the
// earliest message in the topic 'my-topic' the first time you run the program.
AutoOffsetReset = AutoOffsetReset.Earliest,
SecurityProtocol = SecurityProtocol.SaslSsl,
SaslMechanism = SaslMechanism.Plain,
Expand Down

0 comments on commit 5810164

Please sign in to comment.