Skip to content

Commit f1a3109

Browse files
authored
Fix IsolationLevel enum values (#1098)
1 parent 250ec24 commit f1a3109

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

src/Confluent.Kafka/Config.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ public class Config : IEnumerable<KeyValuePair<string, string>>
3131
{
3232
{ "saslplaintext", "sasl_plaintext" },
3333
{ "saslssl", "sasl_ssl" },
34-
{ "consistentrandom", "consistent_random"},
35-
{ "murmur2random", "murmur2_random"}
34+
{ "consistentrandom", "consistent_random" },
35+
{ "murmur2random", "murmur2_random" },
36+
{ "readcommitted", "read_committed" },
37+
{ "readuncommitted", "read_uncommitted" }
3638
};
3739

3840
/// <summary>

test/Confluent.Kafka.UnitTests/Consumer.cs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace Confluent.Kafka.UnitTests
2525
public class ConsumerTests
2626
{
2727
[Fact]
28-
public void Constuctor()
28+
public void Constructor()
2929
{
3030
// Throw exception if 'group.id' is not set in config and ensure that exception
3131
// mentions 'group.id'.
@@ -63,6 +63,28 @@ public void Constuctor()
6363
Assert.Contains("range", e.Message);
6464
}
6565

66+
[Fact]
67+
public void Constructor_ConsumerTxn()
68+
{
69+
// should not throw
70+
using (var c = new ConsumerBuilder<byte[], byte[]>(new ConsumerConfig
71+
{
72+
BootstrapServers = "localhost:666",
73+
GroupId = Guid.NewGuid().ToString(),
74+
IsolationLevel = IsolationLevel.ReadCommitted
75+
}).Build())
76+
{ }
77+
78+
// should not throw
79+
using (var c = new ConsumerBuilder<byte[], byte[]>(new ConsumerConfig
80+
{
81+
BootstrapServers = "localhost:666",
82+
GroupId = Guid.NewGuid().ToString(),
83+
IsolationLevel = IsolationLevel.ReadUncommitted
84+
}).Build())
85+
{ }
86+
}
87+
6688
private static ConsumerConfig CreateValidConfiguration()
6789
{
6890
return new ConsumerConfig

0 commit comments

Comments
 (0)