Browse Source

Fixed kafka consumer group does not works bug. #541

master
Savorboard 4 years ago
parent
commit
f948c8db50
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/DotNetCore.CAP.Kafka/KafkaConsumerClient.cs

+ 3
- 3
src/DotNetCore.CAP.Kafka/KafkaConsumerClient.cs View File

@@ -14,7 +14,7 @@ namespace DotNetCore.CAP.Kafka
{ {
internal sealed class KafkaConsumerClient : IConsumerClient internal sealed class KafkaConsumerClient : IConsumerClient
{ {
private readonly SemaphoreSlim _connectionLock = new SemaphoreSlim(initialCount: 1, maxCount: 1);
private static readonly SemaphoreSlim ConnectionLock = new SemaphoreSlim(initialCount: 1, maxCount: 1);


private readonly string _groupId; private readonly string _groupId;
private readonly KafkaOptions _kafkaOptions; private readonly KafkaOptions _kafkaOptions;
@@ -100,7 +100,7 @@ namespace DotNetCore.CAP.Kafka
return; return;
} }


_connectionLock.Wait();
ConnectionLock.Wait();


try try
{ {
@@ -117,7 +117,7 @@ namespace DotNetCore.CAP.Kafka
} }
finally finally
{ {
_connectionLock.Release();
ConnectionLock.Release();
} }
} }




Loading…
Cancel
Save