rdkafka 0.13.0 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +388 -111
  3. data/{LICENSE → MIT-LICENSE} +2 -1
  4. data/README.md +90 -43
  5. data/Rakefile +21 -23
  6. data/bin/verify_kafka_warnings +44 -0
  7. data/dist/librdkafka-2.15.1.tar.gz +0 -0
  8. data/dist/patches/rdkafka_global_init.patch +15 -0
  9. data/docker-compose-ssl.yml +39 -0
  10. data/docker-compose.yml +22 -17
  11. data/ext/Rakefile +97 -30
  12. data/lib/rdkafka/abstract_handle.rb +113 -34
  13. data/lib/rdkafka/admin/acl_binding_result.rb +51 -0
  14. data/lib/rdkafka/admin/alter_consumer_group_offsets_handle.rb +31 -0
  15. data/lib/rdkafka/admin/alter_consumer_group_offsets_report.rb +50 -0
  16. data/lib/rdkafka/admin/config_binding_result.rb +30 -0
  17. data/lib/rdkafka/admin/config_resource_binding_result.rb +19 -0
  18. data/lib/rdkafka/admin/create_acl_handle.rb +32 -0
  19. data/lib/rdkafka/admin/create_acl_report.rb +26 -0
  20. data/lib/rdkafka/admin/create_partitions_handle.rb +28 -0
  21. data/lib/rdkafka/admin/create_partitions_report.rb +7 -0
  22. data/lib/rdkafka/admin/create_topic_handle.rb +8 -7
  23. data/lib/rdkafka/admin/create_topic_report.rb +4 -1
  24. data/lib/rdkafka/admin/delete_acl_handle.rb +31 -0
  25. data/lib/rdkafka/admin/delete_acl_report.rb +25 -0
  26. data/lib/rdkafka/admin/delete_consumer_group_offsets_handle.rb +31 -0
  27. data/lib/rdkafka/admin/delete_consumer_group_offsets_report.rb +50 -0
  28. data/lib/rdkafka/admin/delete_groups_handle.rb +31 -0
  29. data/lib/rdkafka/admin/delete_groups_report.rb +27 -0
  30. data/lib/rdkafka/admin/delete_records_handle.rb +31 -0
  31. data/lib/rdkafka/admin/delete_records_report.rb +25 -0
  32. data/lib/rdkafka/admin/delete_topic_handle.rb +8 -7
  33. data/lib/rdkafka/admin/delete_topic_report.rb +4 -1
  34. data/lib/rdkafka/admin/describe_acl_handle.rb +31 -0
  35. data/lib/rdkafka/admin/describe_acl_report.rb +27 -0
  36. data/lib/rdkafka/admin/describe_cluster_handle.rb +31 -0
  37. data/lib/rdkafka/admin/describe_cluster_report.rb +48 -0
  38. data/lib/rdkafka/admin/describe_configs_handle.rb +30 -0
  39. data/lib/rdkafka/admin/describe_configs_report.rb +56 -0
  40. data/lib/rdkafka/admin/describe_consumer_groups_handle.rb +31 -0
  41. data/lib/rdkafka/admin/describe_consumer_groups_report.rb +151 -0
  42. data/lib/rdkafka/admin/describe_result_parsing.rb +47 -0
  43. data/lib/rdkafka/admin/describe_topics_handle.rb +31 -0
  44. data/lib/rdkafka/admin/describe_topics_report.rb +118 -0
  45. data/lib/rdkafka/admin/incremental_alter_configs_handle.rb +30 -0
  46. data/lib/rdkafka/admin/incremental_alter_configs_report.rb +56 -0
  47. data/lib/rdkafka/admin/list_consumer_groups_handle.rb +31 -0
  48. data/lib/rdkafka/admin/list_consumer_groups_report.rb +83 -0
  49. data/lib/rdkafka/admin/list_offsets_handle.rb +31 -0
  50. data/lib/rdkafka/admin/list_offsets_report.rb +54 -0
  51. data/lib/rdkafka/admin.rb +1381 -38
  52. data/lib/rdkafka/bindings/admin/acls.rb +85 -0
  53. data/lib/rdkafka/bindings/admin/configs.rb +37 -0
  54. data/lib/rdkafka/bindings/admin/list_offsets.rb +26 -0
  55. data/lib/rdkafka/bindings/admin.rb +197 -0
  56. data/lib/rdkafka/bindings/callbacks.rb +100 -0
  57. data/lib/rdkafka/bindings/configuration.rb +50 -0
  58. data/lib/rdkafka/bindings/consumer.rb +83 -0
  59. data/lib/rdkafka/bindings/errors.rb +15 -0
  60. data/lib/rdkafka/bindings/handle.rb +16 -0
  61. data/lib/rdkafka/bindings/messages.rb +28 -0
  62. data/lib/rdkafka/bindings/metadata.rb +14 -0
  63. data/lib/rdkafka/bindings/polling.rb +17 -0
  64. data/lib/rdkafka/bindings/producer.rb +77 -0
  65. data/lib/rdkafka/bindings/structs.rb +62 -0
  66. data/lib/rdkafka/bindings.rb +69 -294
  67. data/lib/rdkafka/callbacks/alter_consumer_group_offsets_handler.rb +65 -0
  68. data/lib/rdkafka/callbacks/base_handler.rb +62 -0
  69. data/lib/rdkafka/callbacks/create_acl_handler.rb +37 -0
  70. data/lib/rdkafka/callbacks/create_partitions_handler.rb +37 -0
  71. data/lib/rdkafka/callbacks/create_topic_handler.rb +37 -0
  72. data/lib/rdkafka/callbacks/delete_acl_handler.rb +42 -0
  73. data/lib/rdkafka/callbacks/delete_consumer_group_offsets_handler.rb +65 -0
  74. data/lib/rdkafka/callbacks/delete_groups_handler.rb +37 -0
  75. data/lib/rdkafka/callbacks/delete_records_handler.rb +38 -0
  76. data/lib/rdkafka/callbacks/delete_topic_handler.rb +37 -0
  77. data/lib/rdkafka/callbacks/describe_acl_handler.rb +35 -0
  78. data/lib/rdkafka/callbacks/describe_cluster_handler.rb +36 -0
  79. data/lib/rdkafka/callbacks/describe_configs_handler.rb +42 -0
  80. data/lib/rdkafka/callbacks/describe_consumer_groups_handler.rb +36 -0
  81. data/lib/rdkafka/callbacks/describe_topics_handler.rb +36 -0
  82. data/lib/rdkafka/callbacks/incremental_alter_configs_handler.rb +42 -0
  83. data/lib/rdkafka/callbacks/list_consumer_groups_handler.rb +39 -0
  84. data/lib/rdkafka/callbacks/list_offsets_handler.rb +42 -0
  85. data/lib/rdkafka/callbacks.rb +273 -52
  86. data/lib/rdkafka/clients.rb +81 -0
  87. data/lib/rdkafka/config.rb +333 -91
  88. data/lib/rdkafka/consumer/allocator.rb +38 -0
  89. data/lib/rdkafka/consumer/headers.rb +39 -25
  90. data/lib/rdkafka/consumer/message.rb +18 -20
  91. data/lib/rdkafka/consumer/partition.rb +15 -4
  92. data/lib/rdkafka/consumer/topic_partition_list.rb +82 -48
  93. data/lib/rdkafka/consumer.rb +765 -192
  94. data/lib/rdkafka/defaults.rb +123 -0
  95. data/lib/rdkafka/error.rb +40 -14
  96. data/lib/rdkafka/helpers/list_offsets.rb +127 -0
  97. data/lib/rdkafka/helpers/metadata.rb +29 -0
  98. data/lib/rdkafka/helpers/oauth.rb +95 -0
  99. data/lib/rdkafka/helpers/time.rb +19 -0
  100. data/lib/rdkafka/metadata.rb +138 -26
  101. data/lib/rdkafka/native_kafka.rb +142 -22
  102. data/lib/rdkafka/producer/delivery_handle.rb +27 -7
  103. data/lib/rdkafka/producer/delivery_report.rb +71 -4
  104. data/lib/rdkafka/producer/partitions_count_cache.rb +212 -0
  105. data/lib/rdkafka/producer.rb +422 -81
  106. data/lib/rdkafka/version.rb +6 -3
  107. data/lib/rdkafka.rb +73 -1
  108. data/package-lock.json +331 -0
  109. data/package.json +9 -0
  110. data/rdkafka.gemspec +78 -25
  111. data/renovate.json +111 -0
  112. metadata +114 -134
  113. data/.gitignore +0 -8
  114. data/.rspec +0 -1
  115. data/.semaphore/semaphore.yml +0 -27
  116. data/.yardopts +0 -2
  117. data/Gemfile +0 -5
  118. data/Guardfile +0 -19
  119. data/ext/README.md +0 -18
  120. data/spec/rdkafka/abstract_handle_spec.rb +0 -115
  121. data/spec/rdkafka/admin/create_topic_handle_spec.rb +0 -54
  122. data/spec/rdkafka/admin/create_topic_report_spec.rb +0 -18
  123. data/spec/rdkafka/admin/delete_topic_handle_spec.rb +0 -54
  124. data/spec/rdkafka/admin/delete_topic_report_spec.rb +0 -18
  125. data/spec/rdkafka/admin_spec.rb +0 -204
  126. data/spec/rdkafka/bindings_spec.rb +0 -136
  127. data/spec/rdkafka/callbacks_spec.rb +0 -22
  128. data/spec/rdkafka/config_spec.rb +0 -197
  129. data/spec/rdkafka/consumer/headers_spec.rb +0 -62
  130. data/spec/rdkafka/consumer/message_spec.rb +0 -141
  131. data/spec/rdkafka/consumer/partition_spec.rb +0 -59
  132. data/spec/rdkafka/consumer/topic_partition_list_spec.rb +0 -225
  133. data/spec/rdkafka/consumer_spec.rb +0 -1106
  134. data/spec/rdkafka/error_spec.rb +0 -91
  135. data/spec/rdkafka/metadata_spec.rb +0 -80
  136. data/spec/rdkafka/native_kafka_spec.rb +0 -124
  137. data/spec/rdkafka/producer/delivery_handle_spec.rb +0 -47
  138. data/spec/rdkafka/producer/delivery_report_spec.rb +0 -23
  139. data/spec/rdkafka/producer_spec.rb +0 -557
  140. data/spec/spec_helper.rb +0 -155
@@ -1,141 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "spec_helper"
4
-
5
- describe Rdkafka::Consumer::Message do
6
- let(:native_client) { new_native_client }
7
- let(:native_topic) { new_native_topic(native_client: native_client) }
8
- let(:payload) { nil }
9
- let(:key) { nil }
10
- let(:native_message) do
11
- Rdkafka::Bindings::Message.new.tap do |message|
12
- message[:rkt] = native_topic
13
- message[:partition] = 3
14
- message[:offset] = 100
15
- if payload
16
- ptr = FFI::MemoryPointer.new(:char, payload.bytesize)
17
- ptr.put_bytes(0, payload)
18
- message[:payload] = ptr
19
- message[:len] = payload.bytesize
20
- end
21
- if key
22
- ptr = FFI::MemoryPointer.new(:char, key.bytesize)
23
- ptr.put_bytes(0, key)
24
- message[:key] = ptr
25
- message[:key_len] = key.bytesize
26
- end
27
- end
28
- end
29
-
30
- after(:each) do
31
- Rdkafka::Bindings.rd_kafka_destroy(native_client)
32
- end
33
-
34
- subject { Rdkafka::Consumer::Message.new(native_message) }
35
-
36
- before do
37
- # mock headers, because it produces 'segmentation fault' while settings or reading headers for
38
- # a message which is created from scratch
39
- #
40
- # Code dump example:
41
- #
42
- # ```
43
- # frame #7: 0x000000010dacf5ab librdkafka.dylib`rd_list_destroy + 11
44
- # frame #8: 0x000000010dae5a7e librdkafka.dylib`rd_kafka_headers_destroy + 14
45
- # frame #9: 0x000000010da9ab40 librdkafka.dylib`rd_kafka_message_set_headers + 32
46
- # ```
47
- expect( Rdkafka::Bindings).to receive(:rd_kafka_message_headers).with(any_args) do
48
- Rdkafka::Bindings::RD_KAFKA_RESP_ERR__NOENT
49
- end
50
- end
51
-
52
- it "should have a topic" do
53
- expect(subject.topic).to eq "topic_name"
54
- end
55
-
56
- it "should have a partition" do
57
- expect(subject.partition).to eq 3
58
- end
59
-
60
- context "payload" do
61
- it "should have a nil payload when none is present" do
62
- expect(subject.payload).to be_nil
63
- end
64
-
65
- context "present payload" do
66
- let(:payload) { "payload content" }
67
-
68
- it "should have a payload" do
69
- expect(subject.payload).to eq "payload content"
70
- end
71
- end
72
- end
73
-
74
- context "key" do
75
- it "should have a nil key when none is present" do
76
- expect(subject.key).to be_nil
77
- end
78
-
79
- context "present key" do
80
- let(:key) { "key content" }
81
-
82
- it "should have a key" do
83
- expect(subject.key).to eq "key content"
84
- end
85
- end
86
- end
87
-
88
- it "should have an offset" do
89
- expect(subject.offset).to eq 100
90
- end
91
-
92
- describe "#timestamp" do
93
- context "without a timestamp" do
94
- before do
95
- allow(Rdkafka::Bindings).to receive(:rd_kafka_message_timestamp).and_return(-1)
96
- end
97
-
98
- it "should have a nil timestamp if not present" do
99
- expect(subject.timestamp).to be_nil
100
- end
101
- end
102
-
103
- context "with a timestamp" do
104
- before do
105
- allow(Rdkafka::Bindings).to receive(:rd_kafka_message_timestamp).and_return(1505069646250)
106
- end
107
-
108
- it "should have timestamp if present" do
109
- expect(subject.timestamp).to eq Time.at(1505069646, 250_000)
110
- end
111
- end
112
- end
113
-
114
- describe "#to_s" do
115
- before do
116
- allow(subject).to receive(:timestamp).and_return(1000)
117
- end
118
-
119
- it "should have a human readable representation" do
120
- expect(subject.to_s).to eq "<Message in 'topic_name' with key '', payload '', partition 3, offset 100, timestamp 1000>"
121
- end
122
-
123
- context "with key and payload" do
124
- let(:key) { "key" }
125
- let(:payload) { "payload" }
126
-
127
- it "should have a human readable representation" do
128
- expect(subject.to_s).to eq "<Message in 'topic_name' with key 'key', payload 'payload', partition 3, offset 100, timestamp 1000>"
129
- end
130
- end
131
-
132
- context "with a very long key and payload" do
133
- let(:key) { "k" * 100_000 }
134
- let(:payload) { "p" * 100_000 }
135
-
136
- it "should have a human readable representation" do
137
- expect(subject.to_s).to eq "<Message in 'topic_name' with key 'kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk...', payload 'pppppppppppppppppppppppppppppppppppppppp...', partition 3, offset 100, timestamp 1000>"
138
- end
139
- end
140
- end
141
- end
@@ -1,59 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "spec_helper"
4
-
5
- describe Rdkafka::Consumer::Partition do
6
- let(:offset) { 100 }
7
- let(:err) { 0 }
8
- subject { Rdkafka::Consumer::Partition.new(1, offset, err) }
9
-
10
- it "should have a partition" do
11
- expect(subject.partition).to eq 1
12
- end
13
-
14
- it "should have an offset" do
15
- expect(subject.offset).to eq 100
16
- end
17
-
18
- it "should have an err code" do
19
- expect(subject.err).to eq 0
20
- end
21
-
22
- describe "#to_s" do
23
- it "should return a human readable representation" do
24
- expect(subject.to_s).to eq "<Partition 1 offset=100>"
25
- end
26
- end
27
-
28
- describe "#inspect" do
29
- it "should return a human readable representation" do
30
- expect(subject.to_s).to eq "<Partition 1 offset=100>"
31
- end
32
-
33
- context "without offset" do
34
- let(:offset) { nil }
35
-
36
- it "should return a human readable representation" do
37
- expect(subject.to_s).to eq "<Partition 1>"
38
- end
39
- end
40
-
41
- context "with err code" do
42
- let(:err) { 1 }
43
-
44
- it "should return a human readable representation" do
45
- expect(subject.to_s).to eq "<Partition 1 offset=100 err=1>"
46
- end
47
- end
48
- end
49
-
50
- describe "#==" do
51
- it "should equal another partition with the same content" do
52
- expect(subject).to eq Rdkafka::Consumer::Partition.new(1, 100)
53
- end
54
-
55
- it "should not equal another partition with different content" do
56
- expect(subject).not_to eq Rdkafka::Consumer::Partition.new(2, 101)
57
- end
58
- end
59
- end
@@ -1,225 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "spec_helper"
4
-
5
- describe Rdkafka::Consumer::TopicPartitionList do
6
- it "should create a new list and add unassigned topics" do
7
- list = Rdkafka::Consumer::TopicPartitionList.new
8
-
9
- expect(list.count).to eq 0
10
- expect(list.empty?).to be true
11
-
12
- list.add_topic("topic1")
13
- list.add_topic("topic2")
14
-
15
- expect(list.count).to eq 2
16
- expect(list.empty?).to be false
17
-
18
- hash = list.to_h
19
- expect(hash.count).to eq 2
20
- expect(hash).to eq ({
21
- "topic1" => nil,
22
- "topic2" => nil
23
- })
24
- end
25
-
26
- it "should create a new list and add assigned topics as a range" do
27
- list = Rdkafka::Consumer::TopicPartitionList.new
28
-
29
- expect(list.count).to eq 0
30
- expect(list.empty?).to be true
31
-
32
- list.add_topic("topic1", (0..2))
33
- list.add_topic("topic2", (0..1))
34
-
35
- expect(list.count).to eq 5
36
- expect(list.empty?).to be false
37
-
38
- hash = list.to_h
39
- expect(hash.count).to eq 2
40
- expect(hash["topic1"]).to eq([
41
- Rdkafka::Consumer::Partition.new(0, nil),
42
- Rdkafka::Consumer::Partition.new(1, nil),
43
- Rdkafka::Consumer::Partition.new(2, nil)
44
- ])
45
- expect(hash["topic2"]).to eq([
46
- Rdkafka::Consumer::Partition.new(0, nil),
47
- Rdkafka::Consumer::Partition.new(1, nil)
48
- ])
49
- end
50
-
51
- it "should create a new list and add assigned topics as an array" do
52
- list = Rdkafka::Consumer::TopicPartitionList.new
53
-
54
- expect(list.count).to eq 0
55
- expect(list.empty?).to be true
56
-
57
- list.add_topic("topic1", [0, 1, 2])
58
- list.add_topic("topic2", [0, 1])
59
-
60
- expect(list.count).to eq 5
61
- expect(list.empty?).to be false
62
-
63
- hash = list.to_h
64
- expect(hash.count).to eq 2
65
- expect(hash["topic1"]).to eq([
66
- Rdkafka::Consumer::Partition.new(0, nil),
67
- Rdkafka::Consumer::Partition.new(1, nil),
68
- Rdkafka::Consumer::Partition.new(2, nil)
69
- ])
70
- expect(hash["topic2"]).to eq([
71
- Rdkafka::Consumer::Partition.new(0, nil),
72
- Rdkafka::Consumer::Partition.new(1, nil)
73
- ])
74
- end
75
-
76
- it "should create a new list and add assigned topics as a count" do
77
- list = Rdkafka::Consumer::TopicPartitionList.new
78
-
79
- expect(list.count).to eq 0
80
- expect(list.empty?).to be true
81
-
82
- list.add_topic("topic1", 3)
83
- list.add_topic("topic2", 2)
84
-
85
- expect(list.count).to eq 5
86
- expect(list.empty?).to be false
87
-
88
- hash = list.to_h
89
- expect(hash.count).to eq 2
90
- expect(hash["topic1"]).to eq([
91
- Rdkafka::Consumer::Partition.new(0, nil),
92
- Rdkafka::Consumer::Partition.new(1, nil),
93
- Rdkafka::Consumer::Partition.new(2, nil)
94
- ])
95
- expect(hash["topic2"]).to eq([
96
- Rdkafka::Consumer::Partition.new(0, nil),
97
- Rdkafka::Consumer::Partition.new(1, nil)
98
- ])
99
- end
100
-
101
- it "should create a new list and add topics and partitions with an offset" do
102
- list = Rdkafka::Consumer::TopicPartitionList.new
103
-
104
- expect(list.count).to eq 0
105
- expect(list.empty?).to be true
106
-
107
- list.add_topic_and_partitions_with_offsets("topic1", 0 => 5, 1 => 6, 2 => 7)
108
-
109
- hash = list.to_h
110
- expect(hash.count).to eq 1
111
- expect(hash["topic1"]).to eq([
112
- Rdkafka::Consumer::Partition.new(0, 5),
113
- Rdkafka::Consumer::Partition.new(1, 6),
114
- Rdkafka::Consumer::Partition.new(2, 7)
115
- ])
116
- end
117
-
118
- describe "#to_s" do
119
- it "should return a human readable representation" do
120
- list = Rdkafka::Consumer::TopicPartitionList.new
121
- list.add_topic("topic1", [0, 1])
122
-
123
- expected = "<TopicPartitionList: {\"topic1\"=>[<Partition 0>, <Partition 1>]}>"
124
-
125
- expect(list.to_s).to eq expected
126
- end
127
- end
128
-
129
- describe "#==" do
130
- subject do
131
- Rdkafka::Consumer::TopicPartitionList.new.tap do |list|
132
- list.add_topic("topic1", [0])
133
- end
134
- end
135
-
136
- it "should equal another partition with the same content" do
137
- other = Rdkafka::Consumer::TopicPartitionList.new.tap do |list|
138
- list.add_topic("topic1", [0])
139
- end
140
- expect(subject).to eq other
141
- end
142
-
143
- it "should not equal another partition with different content" do
144
- expect(subject).not_to eq Rdkafka::Consumer::TopicPartitionList.new
145
- end
146
- end
147
-
148
- describe ".from_native_tpl" do
149
- it "should create a list from an existing native list" do
150
- pointer = Rdkafka::Bindings.rd_kafka_topic_partition_list_new(5)
151
- Rdkafka::Bindings.rd_kafka_topic_partition_list_add(
152
- pointer,
153
- "topic",
154
- -1
155
- )
156
- list = Rdkafka::Consumer::TopicPartitionList.from_native_tpl(pointer)
157
-
158
- other = Rdkafka::Consumer::TopicPartitionList.new.tap do |list|
159
- list.add_topic("topic")
160
- end
161
-
162
- expect(list).to eq other
163
- end
164
-
165
- it "should create a list from an existing native list with offsets" do
166
- pointer = Rdkafka::Bindings.rd_kafka_topic_partition_list_new(5)
167
- Rdkafka::Bindings.rd_kafka_topic_partition_list_add(
168
- pointer,
169
- "topic",
170
- 0
171
- )
172
- Rdkafka::Bindings.rd_kafka_topic_partition_list_set_offset(
173
- pointer,
174
- "topic",
175
- 0,
176
- 100
177
- )
178
- list = Rdkafka::Consumer::TopicPartitionList.from_native_tpl(pointer)
179
-
180
- other = Rdkafka::Consumer::TopicPartitionList.new.tap do |list|
181
- list.add_topic_and_partitions_with_offsets("topic", 0 => 100)
182
- end
183
-
184
- expect(list).to eq other
185
- end
186
- end
187
-
188
- describe "#to_native_tpl" do
189
- it "should create a native list" do
190
- list = Rdkafka::Consumer::TopicPartitionList.new.tap do |list|
191
- list.add_topic("topic")
192
- end
193
-
194
- tpl = list.to_native_tpl
195
-
196
- other = Rdkafka::Consumer::TopicPartitionList.from_native_tpl(tpl)
197
-
198
- expect(list).to eq other
199
- end
200
-
201
- it "should create a native list with partitions" do
202
- list = Rdkafka::Consumer::TopicPartitionList.new.tap do |list|
203
- list.add_topic("topic", 0..16)
204
- end
205
-
206
- tpl = list.to_native_tpl
207
-
208
- other = Rdkafka::Consumer::TopicPartitionList.from_native_tpl(tpl)
209
-
210
- expect(list).to eq other
211
- end
212
-
213
- it "should create a native list with offsets" do
214
- list = Rdkafka::Consumer::TopicPartitionList.new.tap do |list|
215
- list.add_topic_and_partitions_with_offsets("topic", 0 => 100)
216
- end
217
-
218
- tpl = list.to_native_tpl
219
-
220
- other = Rdkafka::Consumer::TopicPartitionList.from_native_tpl(tpl)
221
-
222
- expect(list).to eq other
223
- end
224
- end
225
- end