karafka-rdkafka 0.15.0.alpha2 → 0.15.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f13043e49d80f647a9012f54ec3f54f77c93c275f0a16dbc689b9695a9592ab
4
- data.tar.gz: f1d1d8dbba3389280fa19035b9507e46949b4a34a855147dc68642a12f20a045
3
+ metadata.gz: 35b0da819d785e6087c6dd43c762d815568a1bc69ab3b834d613f00ed7748e83
4
+ data.tar.gz: 4175fc335ebbbabfda1dd348c0c5c0f0f2a2cd4bcd848fd0adf5706acf550796
5
5
  SHA512:
6
- metadata.gz: '09c0e2f0171c07b9d70d75d72878b6a8dd039ab2880be4ddf142eb5542637016bc55da799e9ac79f9ecff9adcd7fc63abe17145bb15bda1ab212220b7aeea8c5'
7
- data.tar.gz: 2eb1fccc6380ca4841f65a6cd319bcffdf848767e4f791c0230d934ba9588735abd8e7d042f6159226c837d7f501c71cce556d683f5b14045610d4aa987c2b02
6
+ metadata.gz: e0d65e75c55f217ceb232e1d0dd6dee5789e8a704d0ec5895d4c87450500d0d480ad9db18a532a67ffc5b970b8dd1e97c8a6be6494e3985a678e811a84036b3c
7
+ data.tar.gz: 8e11cd4865f058af95499a68d5d11c51218b1318f67136e036612e86dc06241279804ed341000940b6bd965adc6711a21f187c532f1381efe51fd18cca0b4205
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -4,6 +4,7 @@
4
4
  - **[Feature]** Oauthbearer token refresh callback (bruce-szalwinski-he)
5
5
  - **[Feature]** Support incremental config describe + alter API (mensfeld)
6
6
  - [Enhancement] Replace time poll based wait engine with an event based to improve response times on blocking operations and wait (nijikon + mensfeld)
7
+ - [Enhancement] Allow for usage of the second regex engine of librdkafka by setting `RDKAFKA_DISABLE_REGEX_EXT` during build (mensfeld)
7
8
  - [Change] The `wait_timeout` argument in `AbstractHandle.wait` method is deprecated and will be removed in future versions without replacement. We don't rely on it's value anymore (nijikon)
8
9
 
9
10
  ## 0.14.10 (2024-02-08)
data/ext/Rakefile CHANGED
@@ -27,6 +27,14 @@ task :default => :clean do
27
27
  :sha256 => Rdkafka::LIBRDKAFKA_SOURCE_SHA256
28
28
  }
29
29
  recipe.configure_options = ["--host=#{recipe.host}"]
30
+
31
+ # Disable using libc regex engine in favor of the embedded one
32
+ # The default regex engine of librdkafka does not always work exactly as most of the users
33
+ # would expect, hence this flag allows for changing it to the other one
34
+ if ENV.key?('RDKAFKA_DISABLE_REGEX_EXT')
35
+ recipe.configure_options << '--disable-regex-ext'
36
+ end
37
+
30
38
  recipe.cook
31
39
  # Move dynamic library we're interested in
32
40
  if recipe.host.include?('darwin')
@@ -214,6 +214,8 @@ module Rdkafka
214
214
  # Redirect the main queue to the consumer queue
215
215
  Rdkafka::Bindings.rd_kafka_poll_set_consumer(kafka) if @consumer_poll_set
216
216
 
217
+ yield(kafka, Rdkafka::Bindings.rd_kafka_name(kafka)) if block_given?
218
+
217
219
  # Return consumer with Kafka client
218
220
  Rdkafka::Consumer.new(
219
221
  Rdkafka::NativeKafka.new(
@@ -239,9 +241,13 @@ module Rdkafka
239
241
  Rdkafka::Bindings.rd_kafka_conf_set_dr_msg_cb(config, Rdkafka::Callbacks::DeliveryCallbackFunction)
240
242
  # Return producer with Kafka client
241
243
  partitioner_name = self[:partitioner] || self["partitioner"]
244
+
245
+ kafka = native_kafka(config, :rd_kafka_producer)
246
+ yield(kafka, Rdkafka::Bindings.rd_kafka_name(kafka)) if block_given?
247
+
242
248
  Rdkafka::Producer.new(
243
249
  Rdkafka::NativeKafka.new(
244
- native_kafka(config, :rd_kafka_producer),
250
+ kafka,
245
251
  run_polling_thread: true,
246
252
  opaque: opaque
247
253
  ),
@@ -261,9 +267,13 @@ module Rdkafka
261
267
  opaque = Opaque.new
262
268
  config = native_config(opaque)
263
269
  Rdkafka::Bindings.rd_kafka_conf_set_background_event_cb(config, Rdkafka::Callbacks::BackgroundEventCallbackFunction)
270
+
271
+ kafka = native_kafka(config, :rd_kafka_producer)
272
+ yield(kafka, Rdkafka::Bindings.rd_kafka_name(kafka)) if block_given?
273
+
264
274
  Rdkafka::Admin.new(
265
275
  Rdkafka::NativeKafka.new(
266
- native_kafka(config, :rd_kafka_producer),
276
+ kafka,
267
277
  run_polling_thread: true,
268
278
  opaque: opaque
269
279
  )
@@ -12,19 +12,30 @@ module Rdkafka
12
12
  # @return [Integer] 0 on success
13
13
  def oauthbearer_set_token(token:, lifetime_ms:, principal_name:, extensions: nil)
14
14
  error_buffer = FFI::MemoryPointer.from_string(" " * 256)
15
- @native_kafka.with_inner do |inner|
16
- response = Rdkafka::Bindings.rd_kafka_oauthbearer_set_token(
15
+
16
+ response = @native_kafka.with_inner do |inner|
17
+ Rdkafka::Bindings.rd_kafka_oauthbearer_set_token(
17
18
  inner, token, lifetime_ms, principal_name,
18
19
  flatten_extensions(extensions), extension_size(extensions), error_buffer, 256
19
20
  )
20
- if response != 0
21
- Rdkafka::Bindings.rd_kafka_oauthbearer_set_token_failure(
22
- inner,
23
- "Failed to set token: #{error_buffer.read_string}"
24
- )
25
- end
26
-
27
- response
21
+ end
22
+
23
+ return response if response.zero?
24
+
25
+ oauthbearer_set_token_failure("Failed to set token: #{error_buffer.read_string}")
26
+
27
+ response
28
+ end
29
+
30
+ # Marks failed oauth token acquire in librdkafka
31
+ #
32
+ # @param reason [String] human readable error reason for failing to acquire token
33
+ def oauthbearer_set_token_failure(reason)
34
+ @native_kafka.with_inner do |inner|
35
+ Rdkafka::Bindings.rd_kafka_oauthbearer_set_token_failure(
36
+ inner,
37
+ reason
38
+ )
28
39
  end
29
40
  end
30
41
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rdkafka
4
- VERSION = "0.15.0.alpha2"
4
+ VERSION = "0.15.0.beta2"
5
5
  LIBRDKAFKA_VERSION = "2.3.0"
6
6
  LIBRDKAFKA_SOURCE_SHA256 = "2d49c35c77eeb3d42fa61c43757fcbb6a206daa560247154e60642bcdcc14d12"
7
7
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karafka-rdkafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0.alpha2
4
+ version: 0.15.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thijs Cadier
@@ -36,7 +36,7 @@ cert_chain:
36
36
  AnG1dJU+yL2BK7vaVytLTstJME5mepSZ46qqIJXMuWob/YPDmVaBF39TDSG9e34s
37
37
  msG3BiCqgOgHAnL23+CN3Rt8MsuRfEtoTKpJVcCfoEoNHOkc
38
38
  -----END CERTIFICATE-----
39
- date: 2024-03-20 00:00:00.000000000 Z
39
+ date: 2024-03-23 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: ffi
metadata.gz.sig CHANGED
Binary file