rdkafka 0.24.2-aarch64-linux-gnu → 0.25.1-aarch64-linux-gnu

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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/Gemfile +8 -0
  4. data/Gemfile.lint +14 -0
  5. data/Gemfile.lint.lock +123 -0
  6. data/README.md +2 -1
  7. data/Rakefile +21 -21
  8. data/docker-compose-ssl.yml +1 -1
  9. data/docker-compose.yml +1 -1
  10. data/ext/librdkafka.so +0 -0
  11. data/lib/rdkafka/abstract_handle.rb +23 -5
  12. data/lib/rdkafka/admin/acl_binding_result.rb +5 -5
  13. data/lib/rdkafka/admin/config_resource_binding_result.rb +1 -0
  14. data/lib/rdkafka/admin/create_acl_handle.rb +7 -4
  15. data/lib/rdkafka/admin/create_acl_report.rb +3 -2
  16. data/lib/rdkafka/admin/create_partitions_handle.rb +8 -5
  17. data/lib/rdkafka/admin/create_partitions_report.rb +1 -0
  18. data/lib/rdkafka/admin/create_topic_handle.rb +8 -5
  19. data/lib/rdkafka/admin/create_topic_report.rb +3 -0
  20. data/lib/rdkafka/admin/delete_acl_handle.rb +9 -6
  21. data/lib/rdkafka/admin/delete_acl_report.rb +5 -3
  22. data/lib/rdkafka/admin/delete_groups_handle.rb +10 -5
  23. data/lib/rdkafka/admin/delete_groups_report.rb +3 -0
  24. data/lib/rdkafka/admin/delete_topic_handle.rb +8 -5
  25. data/lib/rdkafka/admin/delete_topic_report.rb +3 -0
  26. data/lib/rdkafka/admin/describe_acl_handle.rb +9 -6
  27. data/lib/rdkafka/admin/describe_acl_report.rb +5 -3
  28. data/lib/rdkafka/admin/describe_configs_handle.rb +7 -4
  29. data/lib/rdkafka/admin/describe_configs_report.rb +7 -1
  30. data/lib/rdkafka/admin/incremental_alter_configs_handle.rb +7 -4
  31. data/lib/rdkafka/admin/incremental_alter_configs_report.rb +7 -1
  32. data/lib/rdkafka/admin.rb +194 -132
  33. data/lib/rdkafka/bindings.rb +155 -107
  34. data/lib/rdkafka/callbacks.rb +81 -21
  35. data/lib/rdkafka/config.rb +36 -24
  36. data/lib/rdkafka/consumer/headers.rb +3 -2
  37. data/lib/rdkafka/consumer/message.rb +12 -11
  38. data/lib/rdkafka/consumer/partition.rb +8 -4
  39. data/lib/rdkafka/consumer/topic_partition_list.rb +18 -18
  40. data/lib/rdkafka/consumer.rb +247 -42
  41. data/lib/rdkafka/defaults.rb +106 -0
  42. data/lib/rdkafka/error.rb +28 -13
  43. data/lib/rdkafka/helpers/oauth.rb +11 -6
  44. data/lib/rdkafka/helpers/time.rb +5 -0
  45. data/lib/rdkafka/metadata.rb +45 -21
  46. data/lib/rdkafka/native_kafka.rb +89 -4
  47. data/lib/rdkafka/producer/delivery_handle.rb +5 -5
  48. data/lib/rdkafka/producer/delivery_report.rb +8 -4
  49. data/lib/rdkafka/producer/partitions_count_cache.rb +29 -19
  50. data/lib/rdkafka/producer.rb +165 -79
  51. data/lib/rdkafka/version.rb +6 -3
  52. data/lib/rdkafka.rb +1 -0
  53. data/package-lock.json +331 -0
  54. data/package.json +9 -0
  55. data/rdkafka.gemspec +39 -47
  56. data/renovate.json +22 -8
  57. metadata +7 -86
@@ -14,15 +14,49 @@ module Rdkafka
14
14
  module Bindings
15
15
  extend FFI::Library
16
16
 
17
+ # Returns the library extension based on the host OS
18
+ # @return [String] 'dylib' on macOS, 'so' on other systems
17
19
  def self.lib_extension
18
- if RbConfig::CONFIG['host_os'] =~ /darwin/
19
- 'dylib'
20
+ if /darwin/.match?(RbConfig::CONFIG["host_os"])
21
+ "dylib"
20
22
  else
21
- 'so'
23
+ "so"
22
24
  end
23
25
  end
24
26
 
25
- ffi_lib File.join(__dir__, "../../ext/librdkafka.#{lib_extension}")
27
+ # Wrap ffi_lib to provide better error messages for glibc compatibility issues
28
+ begin
29
+ ffi_lib File.join(__dir__, "../../ext/librdkafka.#{lib_extension}")
30
+ rescue LoadError => e
31
+ error_message = e.message
32
+
33
+ # Check if this is a glibc version mismatch error
34
+ if /GLIBC_[\d.]+['"` ]?\s*not found/i.match?(error_message)
35
+ glibc_version = error_message[/GLIBC_([\d.]+)/, 1] || "unknown"
36
+
37
+ raise Rdkafka::LibraryLoadError, <<~ERROR_MSG.strip
38
+ Failed to load librdkafka due to glibc compatibility issue.
39
+
40
+ The precompiled librdkafka binary requires glibc version #{glibc_version} or higher,
41
+ but your system has an older version installed.
42
+
43
+ To resolve this issue, you have two options:
44
+
45
+ 1. Upgrade your system to a supported platform (recommended)
46
+
47
+ 2. Force compilation from source by reinstalling without the precompiled binary:
48
+ gem install rdkafka --platform=ruby
49
+
50
+ Or if using Bundler, add to your Gemfile:
51
+ gem 'rdkafka', force_ruby_platform: true
52
+
53
+ Original error: #{error_message}
54
+ ERROR_MSG
55
+ else
56
+ # Re-raise the original error if it's not a glibc issue
57
+ raise
58
+ end
59
+ end
26
60
 
27
61
  RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS = -175
28
62
  RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS = -174
@@ -30,13 +64,17 @@ module Rdkafka
30
64
  RD_KAFKA_RESP_ERR__NOENT = -156
31
65
  RD_KAFKA_RESP_ERR_NO_ERROR = 0
32
66
 
33
- RD_KAFKA_OFFSET_END = -1
67
+ RD_KAFKA_OFFSET_END = -1
34
68
  RD_KAFKA_OFFSET_BEGINNING = -2
35
- RD_KAFKA_OFFSET_STORED = -1000
36
- RD_KAFKA_OFFSET_INVALID = -1001
69
+ RD_KAFKA_OFFSET_STORED = -1000
70
+ RD_KAFKA_OFFSET_INVALID = -1001
71
+
72
+ RD_KAFKA_PARTITION_UA = -1
73
+ RD_KAFKA_PARTITION_UA_STR = RD_KAFKA_PARTITION_UA.to_s.freeze
37
74
 
38
75
  EMPTY_HASH = {}.freeze
39
76
 
77
+ # FFI struct for size_t pointer wrapper
40
78
  class SizePtr < FFI::Struct
41
79
  layout :value, :size_t
42
80
  end
@@ -52,6 +90,12 @@ module Rdkafka
52
90
  attach_function :rd_kafka_poll, [:pointer, :int], :int, blocking: true
53
91
  attach_function :rd_kafka_outq_len, [:pointer], :int, blocking: true
54
92
 
93
+ # Non-blocking poll variants (do not release GVL)
94
+ # These are more efficient for poll(0) calls in fiber schedulers where GVL
95
+ # release/reacquire overhead is wasteful since we don't expect to wait.
96
+ # Uses the same underlying C function but with blocking: false to skip GVL release.
97
+ attach_function :rd_kafka_poll_nb, :rd_kafka_poll, [:pointer, :int], :int, blocking: false
98
+
55
99
  # Metadata
56
100
 
57
101
  attach_function :rd_kafka_name, [:pointer], :string
@@ -60,18 +104,17 @@ module Rdkafka
60
104
  attach_function :rd_kafka_metadata, [:pointer, :int, :pointer, :pointer, :int], :int, blocking: true
61
105
  attach_function :rd_kafka_metadata_destroy, [:pointer], :void, blocking: true
62
106
 
63
- # Message struct
64
-
107
+ # FFI struct representing a Kafka message (rd_kafka_message_t)
65
108
  class Message < FFI::Struct
66
109
  layout :err, :int,
67
- :rkt, :pointer,
68
- :partition, :int32,
69
- :payload, :pointer,
70
- :len, :size_t,
71
- :key, :pointer,
72
- :key_len, :size_t,
73
- :offset, :int64,
74
- :_private, :pointer
110
+ :rkt, :pointer,
111
+ :partition, :int32,
112
+ :payload, :pointer,
113
+ :len, :size_t,
114
+ :key, :pointer,
115
+ :key_len, :size_t,
116
+ :offset, :int64,
117
+ :_private, :pointer
75
118
  end
76
119
 
77
120
  attach_function :rd_kafka_message_destroy, [:pointer], :void
@@ -80,23 +123,23 @@ module Rdkafka
80
123
  attach_function :rd_kafka_topic_destroy, [:pointer], :pointer
81
124
  attach_function :rd_kafka_topic_name, [:pointer], :string
82
125
 
83
- # TopicPartition ad TopicPartitionList structs
84
-
126
+ # FFI struct representing a topic partition (rd_kafka_topic_partition_t)
85
127
  class TopicPartition < FFI::Struct
86
128
  layout :topic, :string,
87
- :partition, :int32,
88
- :offset, :int64,
89
- :metadata, :pointer,
90
- :metadata_size, :size_t,
91
- :opaque, :pointer,
92
- :err, :int,
93
- :_private, :pointer
129
+ :partition, :int32,
130
+ :offset, :int64,
131
+ :metadata, :pointer,
132
+ :metadata_size, :size_t,
133
+ :opaque, :pointer,
134
+ :err, :int,
135
+ :_private, :pointer
94
136
  end
95
137
 
138
+ # FFI struct representing a topic partition list (rd_kafka_topic_partition_list_t)
96
139
  class TopicPartitionList < FFI::Struct
97
140
  layout :cnt, :int,
98
- :size, :int,
99
- :elems, :pointer
141
+ :size, :int,
142
+ :elems, :pointer
100
143
  end
101
144
 
102
145
  attach_function :rd_kafka_topic_partition_list_new, [:int32], :pointer
@@ -105,15 +148,13 @@ module Rdkafka
105
148
  attach_function :rd_kafka_topic_partition_list_destroy, [:pointer], :void
106
149
  attach_function :rd_kafka_topic_partition_list_copy, [:pointer], :pointer
107
150
 
108
- # Configs management
109
- #
110
- # Structs for management of configurations
111
- # Each configuration is attached to a resource and one resource can have many configuration
112
- # details. Each resource will also have separate errors results if obtaining configuration
113
- # was not possible for any reason
151
+ # FFI struct representing a config resource (rd_kafka_ConfigResource_t)
152
+ # Structs for management of configurations. Each configuration is attached to a resource
153
+ # and one resource can have many configuration details. Each resource will also have
154
+ # separate errors results if obtaining configuration was not possible for any reason
114
155
  class ConfigResource < FFI::Struct
115
156
  layout :type, :int,
116
- :name, :string
157
+ :name, :string
117
158
  end
118
159
 
119
160
  attach_function :rd_kafka_DescribeConfigs, [:pointer, :pointer, :size_t, :pointer, :pointer], :void, blocking: true
@@ -142,16 +183,16 @@ module Rdkafka
142
183
  RD_KAFKA_ADMIN_OP_INCREMENTALALTERCONFIGS = 16
143
184
  RD_KAFKA_EVENT_INCREMENTALALTERCONFIGS_RESULT = 131072
144
185
 
145
- RD_KAFKA_ALTER_CONFIG_OP_TYPE_SET = 0
146
- RD_KAFKA_ALTER_CONFIG_OP_TYPE_DELETE = 1
147
- RD_KAFKA_ALTER_CONFIG_OP_TYPE_APPEND = 2
186
+ RD_KAFKA_ALTER_CONFIG_OP_TYPE_SET = 0
187
+ RD_KAFKA_ALTER_CONFIG_OP_TYPE_DELETE = 1
188
+ RD_KAFKA_ALTER_CONFIG_OP_TYPE_APPEND = 2
148
189
  RD_KAFKA_ALTER_CONFIG_OP_TYPE_SUBTRACT = 3
149
190
 
150
- # Errors
191
+ # FFI struct for error description (rd_kafka_err_desc)
151
192
  class NativeErrorDesc < FFI::Struct
152
193
  layout :code, :int,
153
- :name, :pointer,
154
- :desc, :pointer
194
+ :name, :pointer,
195
+ :desc, :pointer
155
196
  end
156
197
 
157
198
  attach_function :rd_kafka_err2name, [:int], :string
@@ -187,6 +228,15 @@ module Rdkafka
187
228
  # Log queue
188
229
  attach_function :rd_kafka_set_log_queue, [:pointer, :pointer], :void
189
230
  attach_function :rd_kafka_queue_get_main, [:pointer], :pointer
231
+ attach_function :rd_kafka_queue_get_background, [:pointer], :pointer
232
+
233
+ # Queue IO Event Support - for fiber scheduler integration
234
+ # Enables notifications to a custom FD when queue transitions from empty to non-empty
235
+ # @param queue rd_kafka_queue_t* - the queue to monitor
236
+ # @param fd int - file descriptor to write to (provide your own pipe/eventfd)
237
+ # @param payload const void* - data to write to fd
238
+ # @param size size_t - size of payload
239
+ attach_function :rd_kafka_queue_io_event_enable, [:pointer, :int, :pointer, :size_t], :void
190
240
  # Per topic configs
191
241
  attach_function :rd_kafka_topic_conf_new, [], :pointer
192
242
  attach_function :rd_kafka_topic_conf_set, [:pointer, :string, :string, :pointer, :int], :kafka_config_response
@@ -195,19 +245,19 @@ module Rdkafka
195
245
  :void, [:pointer, :int, :string, :string]
196
246
  ) do |_client_ptr, level, _level_string, line|
197
247
  severity = case level
198
- when 0, 1, 2
199
- Logger::FATAL
200
- when 3
201
- Logger::ERROR
202
- when 4
203
- Logger::WARN
204
- when 5, 6
205
- Logger::INFO
206
- when 7
207
- Logger::DEBUG
208
- else
209
- Logger::UNKNOWN
210
- end
248
+ when 0, 1, 2
249
+ Logger::FATAL
250
+ when 3
251
+ Logger::ERROR
252
+ when 4
253
+ Logger::WARN
254
+ when 5, 6
255
+ Logger::INFO
256
+ when 7
257
+ Logger::DEBUG
258
+ else
259
+ Logger::UNKNOWN
260
+ end
211
261
 
212
262
  Rdkafka::Config.ensure_log_thread
213
263
  Rdkafka::Config.log_queue << [severity, "rdkafka: #{line}"]
@@ -233,8 +283,8 @@ module Rdkafka
233
283
  #
234
284
  # Since this cache is shared, having few consumers and/or producers in one process will
235
285
  # automatically improve the querying times even with low refresh times.
236
- (stats['topics'] || EMPTY_HASH).each do |topic_name, details|
237
- partitions_count = details['partitions'].keys.reject { |k| k == '-1' }.size
286
+ (stats["topics"] || EMPTY_HASH).each do |topic_name, details|
287
+ partitions_count = details["partitions"].keys.count { |k| !(k == RD_KAFKA_PARTITION_UA_STR) }
238
288
 
239
289
  next unless partitions_count.positive?
240
290
 
@@ -245,7 +295,7 @@ module Rdkafka
245
295
  end
246
296
 
247
297
  # Return 0 so librdkafka frees the json string
248
- 0
298
+ RD_KAFKA_RESP_ERR_NO_ERROR
249
299
  end
250
300
 
251
301
  ErrorCallback = FFI::Function.new(
@@ -279,9 +329,7 @@ module Rdkafka
279
329
  OAuthbearerTokenRefreshCallback = FFI::Function.new(
280
330
  :void, [:pointer, :string, :pointer]
281
331
  ) do |client_ptr, config, _opaque|
282
- if Rdkafka::Config.oauthbearer_token_refresh_callback
283
- Rdkafka::Config.oauthbearer_token_refresh_callback.call(config, Rdkafka::Bindings.rd_kafka_name(client_ptr))
284
- end
332
+ Rdkafka::Config.oauthbearer_token_refresh_callback&.call(config, Rdkafka::Bindings.rd_kafka_name(client_ptr))
285
333
  end
286
334
 
287
335
  # Handle
@@ -309,6 +357,9 @@ module Rdkafka
309
357
  attach_function :rd_kafka_commit, [:pointer, :pointer, :bool], :int, blocking: true
310
358
  attach_function :rd_kafka_poll_set_consumer, [:pointer], :void, blocking: true
311
359
  attach_function :rd_kafka_consumer_poll, [:pointer, :int], :pointer, blocking: true
360
+ # Non-blocking consumer poll variant (does not release GVL)
361
+ # More efficient for poll(0) calls in fiber schedulers.
362
+ attach_function :rd_kafka_consumer_poll_nb, :rd_kafka_consumer_poll, [:pointer, :int], :pointer, blocking: false
312
363
  attach_function :rd_kafka_consumer_close, [:pointer], :void, blocking: true
313
364
  attach_function :rd_kafka_offsets_store, [:pointer, :pointer], :int, blocking: true
314
365
  attach_function :rd_kafka_pause_partitions, [:pointer, :pointer], :int, blocking: true
@@ -368,7 +419,6 @@ module Rdkafka
368
419
  attach_function :rd_kafka_query_watermark_offsets, [:pointer, :string, :int, :pointer, :pointer, :int], :int
369
420
 
370
421
  # Producer
371
-
372
422
  RD_KAFKA_VTYPE_END = 0
373
423
  RD_KAFKA_VTYPE_TOPIC = 1
374
424
  RD_KAFKA_VTYPE_RKT = 2
@@ -390,16 +440,25 @@ module Rdkafka
390
440
  callback :delivery_cb, [:pointer, :pointer, :pointer], :void
391
441
  attach_function :rd_kafka_conf_set_dr_msg_cb, [:pointer, :delivery_cb], :void
392
442
 
393
- # Partitioner
394
- PARTITIONERS = %w(random consistent consistent_random murmur2 murmur2_random fnv1a fnv1a_random).each_with_object({}) do |name, hsh|
395
- method_name = "rd_kafka_msg_partitioner_#{name}".to_sym
443
+ # Hash mapping partitioner names to their FFI function symbols
444
+ # @return [Hash{String => Symbol}]
445
+ PARTITIONERS = %w[random consistent consistent_random murmur2 murmur2_random fnv1a fnv1a_random].each_with_object({}) do |name, hsh|
446
+ method_name = :"rd_kafka_msg_partitioner_#{name}"
396
447
  attach_function method_name, [:pointer, :pointer, :size_t, :int32, :pointer, :pointer], :int32
397
448
  hsh[name] = method_name
398
449
  end
399
450
 
451
+ # Calculates the partition for a message based on the partitioner
452
+ #
453
+ # @param topic_ptr [FFI::Pointer] pointer to the topic handle
454
+ # @param str [String] the partition key string
455
+ # @param partition_count [Integer, nil] number of partitions
456
+ # @param partitioner [String] name of the partitioner to use
457
+ # @return [Integer] partition number or RD_KAFKA_PARTITION_UA if unassigned
458
+ # @raise [Rdkafka::Config::ConfigError] when an unknown partitioner is specified
400
459
  def self.partitioner(topic_ptr, str, partition_count, partitioner = "consistent_random")
401
460
  # Return RD_KAFKA_PARTITION_UA(unassigned partition) when partition count is nil/zero.
402
- return -1 unless partition_count&.nonzero?
461
+ return RD_KAFKA_PARTITION_UA unless partition_count&.nonzero?
403
462
 
404
463
  str_ptr = str.empty? ? FFI::MemoryPointer::NULL : FFI::MemoryPointer.from_string(str)
405
464
  method_name = PARTITIONERS.fetch(partitioner) do
@@ -410,8 +469,7 @@ module Rdkafka
410
469
  end
411
470
 
412
471
  # Create Topics
413
-
414
- RD_KAFKA_ADMIN_OP_CREATETOPICS = 1 # rd_kafka_admin_op_t
472
+ RD_KAFKA_ADMIN_OP_CREATETOPICS = 1 # rd_kafka_admin_op_t
415
473
  RD_KAFKA_EVENT_CREATETOPICS_RESULT = 100 # rd_kafka_event_type_t
416
474
 
417
475
  attach_function :rd_kafka_CreateTopics, [:pointer, :pointer, :size_t, :pointer, :pointer], :void, blocking: true
@@ -422,8 +480,7 @@ module Rdkafka
422
480
  attach_function :rd_kafka_CreateTopics_result_topics, [:pointer, :pointer], :pointer, blocking: true
423
481
 
424
482
  # Delete Topics
425
-
426
- RD_KAFKA_ADMIN_OP_DELETETOPICS = 2 # rd_kafka_admin_op_t
483
+ RD_KAFKA_ADMIN_OP_DELETETOPICS = 2 # rd_kafka_admin_op_t
427
484
  RD_KAFKA_EVENT_DELETETOPICS_RESULT = 101 # rd_kafka_event_type_t
428
485
 
429
486
  attach_function :rd_kafka_DeleteTopics, [:pointer, :pointer, :size_t, :pointer, :pointer], :int32, blocking: true
@@ -443,7 +500,6 @@ module Rdkafka
443
500
  attach_function :rd_kafka_CreatePartitions_result_topics, [:pointer, :pointer], :pointer
444
501
 
445
502
  # Delete Group
446
-
447
503
  RD_KAFKA_ADMIN_OP_DELETEGROUPS = 7 # rd_kafka_admin_op_t
448
504
  RD_KAFKA_EVENT_DELETEGROUPS_RESULT = 106 # rd_kafka_event_type_t
449
505
 
@@ -455,7 +511,6 @@ module Rdkafka
455
511
 
456
512
  # Background Queue and Callback
457
513
 
458
- attach_function :rd_kafka_queue_get_background, [:pointer], :pointer
459
514
  attach_function :rd_kafka_conf_set_background_event_cb, [:pointer, :pointer], :void
460
515
  attach_function :rd_kafka_queue_destroy, [:pointer], :void
461
516
 
@@ -477,8 +532,7 @@ module Rdkafka
477
532
  attach_function :rd_kafka_topic_result_name, [:pointer], :pointer
478
533
 
479
534
  # Create Acls
480
-
481
- RD_KAFKA_ADMIN_OP_CREATEACLS = 9
535
+ RD_KAFKA_ADMIN_OP_CREATEACLS = 9
482
536
  RD_KAFKA_EVENT_CREATEACLS_RESULT = 1024
483
537
 
484
538
  attach_function :rd_kafka_CreateAcls, [:pointer, :pointer, :size_t, :pointer, :pointer], :void
@@ -486,8 +540,7 @@ module Rdkafka
486
540
  attach_function :rd_kafka_CreateAcls_result_acls, [:pointer, :pointer], :pointer
487
541
 
488
542
  # Delete Acls
489
-
490
- RD_KAFKA_ADMIN_OP_DELETEACLS = 11
543
+ RD_KAFKA_ADMIN_OP_DELETEACLS = 11
491
544
  RD_KAFKA_EVENT_DELETEACLS_RESULT = 4096
492
545
 
493
546
  attach_function :rd_kafka_DeleteAcls, [:pointer, :pointer, :size_t, :pointer, :pointer], :void
@@ -497,8 +550,7 @@ module Rdkafka
497
550
  attach_function :rd_kafka_DeleteAcls_result_response_matching_acls, [:pointer, :pointer], :pointer
498
551
 
499
552
  # Describe Acls
500
-
501
- RD_KAFKA_ADMIN_OP_DESCRIBEACLS = 10
553
+ RD_KAFKA_ADMIN_OP_DESCRIBEACLS = 10
502
554
  RD_KAFKA_EVENT_DESCRIBEACLS_RESULT = 2048
503
555
 
504
556
  attach_function :rd_kafka_DescribeAcls, [:pointer, :pointer, :pointer, :pointer], :void
@@ -514,45 +566,42 @@ module Rdkafka
514
566
  attach_function :rd_kafka_AclBinding_host, [:pointer], :pointer
515
567
  attach_function :rd_kafka_AclBinding_operation, [:pointer], :int32
516
568
  attach_function :rd_kafka_AclBinding_permission_type, [:pointer], :int32
517
- attach_function :rd_kafka_AclBinding_new, [:int32, :pointer, :int32, :pointer, :pointer, :int32, :int32, :pointer, :size_t ], :pointer
518
- attach_function :rd_kafka_AclBindingFilter_new, [:int32, :pointer, :int32, :pointer, :pointer, :int32, :int32, :pointer, :size_t ], :pointer
569
+ attach_function :rd_kafka_AclBinding_new, [:int32, :pointer, :int32, :pointer, :pointer, :int32, :int32, :pointer, :size_t], :pointer
570
+ attach_function :rd_kafka_AclBindingFilter_new, [:int32, :pointer, :int32, :pointer, :pointer, :int32, :int32, :pointer, :size_t], :pointer
519
571
  attach_function :rd_kafka_AclBinding_destroy, [:pointer], :void
520
572
 
521
573
  # rd_kafka_ResourceType_t - https://github.com/confluentinc/librdkafka/blob/292d2a66b9921b783f08147807992e603c7af059/src/rdkafka.h#L7307
522
-
523
- RD_KAFKA_RESOURCE_ANY = 1
574
+ RD_KAFKA_RESOURCE_ANY = 1
524
575
  RD_KAFKA_RESOURCE_TOPIC = 2
525
576
  RD_KAFKA_RESOURCE_GROUP = 3
526
577
  RD_KAFKA_RESOURCE_BROKER = 4
527
578
  RD_KAFKA_RESOURCE_TRANSACTIONAL_ID = 5
528
579
 
529
580
  # rd_kafka_ResourcePatternType_t - https://github.com/confluentinc/librdkafka/blob/292d2a66b9921b783f08147807992e603c7af059/src/rdkafka.h#L7320
530
-
531
- RD_KAFKA_RESOURCE_PATTERN_ANY = 1
532
- RD_KAFKA_RESOURCE_PATTERN_MATCH = 2
533
- RD_KAFKA_RESOURCE_PATTERN_LITERAL = 3
581
+ RD_KAFKA_RESOURCE_PATTERN_UNKNOWN = 0
582
+ RD_KAFKA_RESOURCE_PATTERN_ANY = 1
583
+ RD_KAFKA_RESOURCE_PATTERN_MATCH = 2
584
+ RD_KAFKA_RESOURCE_PATTERN_LITERAL = 3
534
585
  RD_KAFKA_RESOURCE_PATTERN_PREFIXED = 4
535
586
 
536
587
  # rd_kafka_AclOperation_t - https://github.com/confluentinc/librdkafka/blob/292d2a66b9921b783f08147807992e603c7af059/src/rdkafka.h#L8403
537
-
538
- RD_KAFKA_ACL_OPERATION_ANY = 1
539
- RD_KAFKA_ACL_OPERATION_ALL = 2
540
- RD_KAFKA_ACL_OPERATION_READ = 3
541
- RD_KAFKA_ACL_OPERATION_WRITE = 4
542
- RD_KAFKA_ACL_OPERATION_CREATE = 5
543
- RD_KAFKA_ACL_OPERATION_DELETE = 6
544
- RD_KAFKA_ACL_OPERATION_ALTER = 7
545
- RD_KAFKA_ACL_OPERATION_DESCRIBE = 8
546
- RD_KAFKA_ACL_OPERATION_CLUSTER_ACTION = 9
588
+ RD_KAFKA_ACL_OPERATION_ANY = 1
589
+ RD_KAFKA_ACL_OPERATION_ALL = 2
590
+ RD_KAFKA_ACL_OPERATION_READ = 3
591
+ RD_KAFKA_ACL_OPERATION_WRITE = 4
592
+ RD_KAFKA_ACL_OPERATION_CREATE = 5
593
+ RD_KAFKA_ACL_OPERATION_DELETE = 6
594
+ RD_KAFKA_ACL_OPERATION_ALTER = 7
595
+ RD_KAFKA_ACL_OPERATION_DESCRIBE = 8
596
+ RD_KAFKA_ACL_OPERATION_CLUSTER_ACTION = 9
547
597
  RD_KAFKA_ACL_OPERATION_DESCRIBE_CONFIGS = 10
548
- RD_KAFKA_ACL_OPERATION_ALTER_CONFIGS = 11
598
+ RD_KAFKA_ACL_OPERATION_ALTER_CONFIGS = 11
549
599
  RD_KAFKA_ACL_OPERATION_IDEMPOTENT_WRITE = 12
550
600
 
551
601
  # rd_kafka_AclPermissionType_t - https://github.com/confluentinc/librdkafka/blob/292d2a66b9921b783f08147807992e603c7af059/src/rdkafka.h#L8435
552
-
553
- RD_KAFKA_ACL_PERMISSION_TYPE_ANY = 1
554
- RD_KAFKA_ACL_PERMISSION_TYPE_DENY = 2
555
- RD_KAFKA_ACL_PERMISSION_TYPE_ALLOW = 3
602
+ RD_KAFKA_ACL_PERMISSION_TYPE_ANY = 1
603
+ RD_KAFKA_ACL_PERMISSION_TYPE_DENY = 2
604
+ RD_KAFKA_ACL_PERMISSION_TYPE_ALLOW = 3
556
605
 
557
606
  # Extracting error details from Acl results
558
607
  attach_function :rd_kafka_acl_result_error, [:pointer], :pointer
@@ -562,14 +611,13 @@ module Rdkafka
562
611
  attach_function :rd_kafka_event_error_string, [:pointer], :pointer
563
612
  attach_function :rd_kafka_AclBinding_error, [:pointer], :pointer
564
613
 
565
-
566
- # Extracting data from group results
567
- class NativeError < FFI::Struct # rd_kafka_error_t
614
+ # FFI struct for native error (rd_kafka_error_t)
615
+ class NativeError < FFI::Struct
568
616
  layout :code, :int32,
569
- :errstr, :pointer,
570
- :fatal, :u_int8_t,
571
- :retriable, :u_int8_t,
572
- :txn_requires_abort, :u_int8_t
617
+ :errstr, :pointer,
618
+ :fatal, :u_int8_t,
619
+ :retriable, :u_int8_t,
620
+ :txn_requires_abort, :u_int8_t
573
621
  end
574
622
 
575
623
  attach_function :rd_kafka_group_result_error, [:pointer], NativeError.by_ref # rd_kafka_group_result_t* => rd_kafka_error_t*