rdkafka 0.22.2-x86_64-linux-musl → 0.23.0-x86_64-linux-musl

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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/README.md +15 -14
  4. data/docker-compose-ssl.yml +35 -0
  5. data/ext/librdkafka.so +0 -0
  6. data/lib/rdkafka/admin.rb +0 -1
  7. data/lib/rdkafka/config.rb +1 -4
  8. data/lib/rdkafka/consumer/topic_partition_list.rb +5 -1
  9. data/lib/rdkafka/consumer.rb +2 -2
  10. data/lib/rdkafka/producer.rb +3 -3
  11. data/lib/rdkafka/version.rb +3 -3
  12. data/rdkafka.gemspec +35 -6
  13. data/renovate.json +5 -17
  14. metadata +32 -52
  15. data/.github/CODEOWNERS +0 -3
  16. data/.github/FUNDING.yml +0 -1
  17. data/.github/workflows/ci_linux_x86_64_gnu.yml +0 -271
  18. data/.github/workflows/ci_linux_x86_64_musl.yml +0 -194
  19. data/.github/workflows/ci_macos_arm64.yml +0 -284
  20. data/.github/workflows/push_linux_x86_64_gnu.yml +0 -65
  21. data/.github/workflows/push_linux_x86_64_musl.yml +0 -79
  22. data/.github/workflows/push_macos_arm64.yml +0 -54
  23. data/.github/workflows/push_ruby.yml +0 -37
  24. data/.github/workflows/verify-action-pins.yml +0 -16
  25. data/.gitignore +0 -14
  26. data/.rspec +0 -2
  27. data/.ruby-gemset +0 -1
  28. data/.ruby-version +0 -1
  29. data/.yardopts +0 -2
  30. data/ext/README.md +0 -19
  31. data/ext/Rakefile +0 -131
  32. data/ext/build_common.sh +0 -361
  33. data/ext/build_linux_x86_64_gnu.sh +0 -306
  34. data/ext/build_linux_x86_64_musl.sh +0 -763
  35. data/ext/build_macos_arm64.sh +0 -550
  36. data/spec/rdkafka/abstract_handle_spec.rb +0 -117
  37. data/spec/rdkafka/admin/create_acl_handle_spec.rb +0 -56
  38. data/spec/rdkafka/admin/create_acl_report_spec.rb +0 -18
  39. data/spec/rdkafka/admin/create_topic_handle_spec.rb +0 -52
  40. data/spec/rdkafka/admin/create_topic_report_spec.rb +0 -16
  41. data/spec/rdkafka/admin/delete_acl_handle_spec.rb +0 -85
  42. data/spec/rdkafka/admin/delete_acl_report_spec.rb +0 -72
  43. data/spec/rdkafka/admin/delete_topic_handle_spec.rb +0 -52
  44. data/spec/rdkafka/admin/delete_topic_report_spec.rb +0 -16
  45. data/spec/rdkafka/admin/describe_acl_handle_spec.rb +0 -85
  46. data/spec/rdkafka/admin/describe_acl_report_spec.rb +0 -73
  47. data/spec/rdkafka/admin_spec.rb +0 -971
  48. data/spec/rdkafka/bindings_spec.rb +0 -199
  49. data/spec/rdkafka/callbacks_spec.rb +0 -20
  50. data/spec/rdkafka/config_spec.rb +0 -258
  51. data/spec/rdkafka/consumer/headers_spec.rb +0 -73
  52. data/spec/rdkafka/consumer/message_spec.rb +0 -139
  53. data/spec/rdkafka/consumer/partition_spec.rb +0 -57
  54. data/spec/rdkafka/consumer/topic_partition_list_spec.rb +0 -248
  55. data/spec/rdkafka/consumer_spec.rb +0 -1274
  56. data/spec/rdkafka/error_spec.rb +0 -89
  57. data/spec/rdkafka/metadata_spec.rb +0 -79
  58. data/spec/rdkafka/native_kafka_spec.rb +0 -130
  59. data/spec/rdkafka/producer/delivery_handle_spec.rb +0 -45
  60. data/spec/rdkafka/producer/delivery_report_spec.rb +0 -25
  61. data/spec/rdkafka/producer/partitions_count_cache_spec.rb +0 -359
  62. data/spec/rdkafka/producer_spec.rb +0 -1345
  63. data/spec/spec_helper.rb +0 -195
data/spec/spec_helper.rb DELETED
@@ -1,195 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- unless ENV["CI"] == "true"
4
- require "simplecov"
5
- SimpleCov.start do
6
- add_filter "/spec/"
7
- end
8
- end
9
-
10
- require "pry"
11
- require "rspec"
12
- require "rdkafka"
13
- require "timeout"
14
- require "securerandom"
15
-
16
- def rdkafka_base_config
17
- {
18
- :"api.version.request" => false,
19
- :"broker.version.fallback" => "1.0",
20
- :"bootstrap.servers" => "127.0.0.1:9092",
21
- # Display statistics and refresh often just to cover those in specs
22
- :'statistics.interval.ms' => 1_000,
23
- :'topic.metadata.refresh.interval.ms' => 1_000
24
- }
25
- end
26
-
27
- def rdkafka_config(config_overrides={})
28
- # Generate the base config
29
- config = rdkafka_base_config
30
- # Merge overrides
31
- config.merge!(config_overrides)
32
- # Return it
33
- Rdkafka::Config.new(config)
34
- end
35
-
36
- def rdkafka_consumer_config(config_overrides={})
37
- # Generate the base config
38
- config = rdkafka_base_config
39
- # Add consumer specific fields to it
40
- config[:"auto.offset.reset"] = "earliest"
41
- config[:"enable.partition.eof"] = false
42
- config[:"group.id"] = "ruby-test-#{SecureRandom.uuid}"
43
- # Enable debug mode if required
44
- if ENV["DEBUG_CONSUMER"]
45
- config[:debug] = "cgrp,topic,fetch"
46
- end
47
- # Merge overrides
48
- config.merge!(config_overrides)
49
- # Return it
50
- Rdkafka::Config.new(config)
51
- end
52
-
53
- def rdkafka_producer_config(config_overrides={})
54
- # Generate the base config
55
- config = rdkafka_base_config
56
- # Enable debug mode if required
57
- if ENV["DEBUG_PRODUCER"]
58
- config[:debug] = "broker,topic,msg"
59
- end
60
- # Merge overrides
61
- config.merge!(config_overrides)
62
- # Return it
63
- Rdkafka::Config.new(config)
64
- end
65
-
66
- def new_native_client
67
- config = rdkafka_consumer_config
68
- config.send(:native_kafka, config.send(:native_config), :rd_kafka_producer)
69
- end
70
-
71
- def new_native_topic(topic_name="topic_name", native_client: )
72
- Rdkafka::Bindings.rd_kafka_topic_new(
73
- native_client,
74
- topic_name,
75
- nil
76
- )
77
- end
78
-
79
- def wait_for_message(topic:, delivery_report:, timeout_in_seconds: 30, consumer: nil)
80
- new_consumer = consumer.nil?
81
- consumer ||= rdkafka_consumer_config('allow.auto.create.topics': true).consumer
82
- consumer.subscribe(topic)
83
- timeout = Time.now.to_i + timeout_in_seconds
84
- retry_count = 0
85
- max_retries = 10
86
-
87
- loop do
88
- if timeout <= Time.now.to_i
89
- raise "Timeout of #{timeout_in_seconds} seconds reached in wait_for_message"
90
- end
91
-
92
- begin
93
- message = consumer.poll(100)
94
- if message &&
95
- message.partition == delivery_report.partition &&
96
- message.offset == delivery_report.offset
97
- return message
98
- end
99
- rescue Rdkafka::RdkafkaError => e
100
- if e.code == :unknown_topic_or_part && retry_count < max_retries
101
- retry_count += 1
102
- sleep(0.1) # Small delay before retry
103
- next
104
- else
105
- raise
106
- end
107
- end
108
- end
109
- ensure
110
- consumer.close if new_consumer
111
- end
112
-
113
- def wait_for_assignment(consumer)
114
- 10.times do
115
- break if !consumer.assignment.empty?
116
- sleep 1
117
- end
118
- end
119
-
120
- def wait_for_unassignment(consumer)
121
- 10.times do
122
- break if consumer.assignment.empty?
123
- sleep 1
124
- end
125
- end
126
-
127
- def notify_listener(listener, &block)
128
- # 1. subscribe and poll
129
- consumer.subscribe("consume_test_topic")
130
- wait_for_assignment(consumer)
131
- consumer.poll(100)
132
-
133
- block.call if block
134
-
135
- # 2. unsubscribe
136
- consumer.unsubscribe
137
- wait_for_unassignment(consumer)
138
- consumer.close
139
- end
140
-
141
- RSpec.configure do |config|
142
- config.filter_run focus: true
143
- config.run_all_when_everything_filtered = true
144
-
145
- config.before(:each) do
146
- Rdkafka::Config.statistics_callback = nil
147
- # We need to clear it so state does not leak between specs
148
- Rdkafka::Producer.partitions_count_cache.to_h.clear
149
- end
150
-
151
- config.before(:suite) do
152
- admin = rdkafka_config.admin
153
- {
154
- consume_test_topic: 3,
155
- empty_test_topic: 3,
156
- load_test_topic: 3,
157
- produce_test_topic: 3,
158
- rake_test_topic: 3,
159
- watermarks_test_topic: 3,
160
- partitioner_test_topic: 25,
161
- example_topic: 1
162
- }.each do |topic, partitions|
163
- create_topic_handle = admin.create_topic(topic.to_s, partitions, 1)
164
- begin
165
- create_topic_handle.wait(max_wait_timeout: 1.0)
166
- rescue Rdkafka::RdkafkaError => ex
167
- raise unless ex.message.match?(/topic_already_exists/)
168
- end
169
- end
170
- admin.close
171
- end
172
-
173
- config.around(:each) do |example|
174
- # Timeout specs after a minute. If they take longer
175
- # they are probably stuck
176
- Timeout::timeout(60) do
177
- example.run
178
- end
179
- end
180
- end
181
-
182
- class RdKafkaTestConsumer
183
- def self.with
184
- consumer = Rdkafka::Bindings.rd_kafka_new(
185
- :rd_kafka_consumer,
186
- nil,
187
- nil,
188
- 0
189
- )
190
- yield consumer
191
- ensure
192
- Rdkafka::Bindings.rd_kafka_consumer_close(consumer)
193
- Rdkafka::Bindings.rd_kafka_destroy(consumer)
194
- end
195
- end