confluentinc / confluent-kafka-dotnet

Confluent's Apache Kafka .NET client
https://github.com/confluentinc/confluent-kafka-dotnet/wiki
Apache License 2.0
61 stars 861 forks source link

Why can Java be used? C # consumption information keeps getting stuck and won't take the next step? #2172

Closed bbhxwl closed 8 months ago

bbhxwl commented 8 months ago

Why can Java be used? C # consumption information keeps getting stuck and won't take the next step?

var config = new ConsumerConfig
{
    BootstrapServers = "********:9092",
    GroupId = "kmerxpehg6vf2zvbtm",
    EnableAutoCommit = false,
    AutoCommitIntervalMs = 1000,
    MaxPollIntervalMs = 360000,
    SessionTimeoutMs = 150000,
    SaslMechanism = SaslMechanism.Plain,
    SecurityProtocol = SecurityProtocol.SaslPlaintext,
    SaslUsername = "openlksn92D",
    SaslPassword = "in9Jws23x52o=n",
    AutoOffsetReset = AutoOffsetReset.Earliest,
    EnableAutoOffsetStore = false,
    StatisticsIntervalMs = 5000,
    EnablePartitionEof = true,
};
var consumer = new ConsumerBuilder<Ignore, string>(config)
   .Build();

consumer.Subscribe("kmerxpehg6vf2zvbtm");
 var consumeResult = consumer.Consume();
anchitj commented 8 months ago

You can go through https://github.com/confluentinc/confluent-kafka-dotnet/blob/master/examples/Consumer/Program.cs for using consumer.