karafka 2.4.4 → 2.4.5
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +1 -1
- data/docker-compose.yml +1 -1
- data/lib/karafka/routing/subscription_group.rb +21 -1
- data/lib/karafka/setup/config.rb +0 -3
- data/lib/karafka/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe76e139b2007e11b0cb9393bc94e2b5b9cad5dc40d69b5ad2bfa34a0555e2b8
|
4
|
+
data.tar.gz: e288c63648d17388f577a45b51267e30fceb4726def0a42c40a9133de27d93f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5e46439a216e66c728ceb74070832407d39b1ebe06d21c858f3e3a0e8e599df15b749318131aa82a5bc994e6dd7ed3094f44639e706a57231f031f0e52186b6
|
7
|
+
data.tar.gz: dc44b6a2f0e5d21bdcbe156f0cc94c324d586c74e9fb757454157ac014897fc3cbd683acb19e6397d668f67a9c68e97d683521f1ceecdbf338e24f3d497c688d
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.3.
|
1
|
+
3.3.4
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Karafka framework changelog
|
2
2
|
|
3
|
+
## 2.4.5 (2024-07-18)
|
4
|
+
- [Change] Inject `client.id` when building subscription group and not during the initial setup.
|
5
|
+
- [Fix] Mitigate `confluentinc/librdkafka/issues/4783` by injecting dynamic client id when using `cooperative-sticky` strategy.
|
6
|
+
|
7
|
+
### Change Note
|
8
|
+
|
9
|
+
`client.id` is technically a low-importance value that should not (aside from this error) impact operations. This is why it is not considered a breaking change. This change may be reverted when the original issue is fixed in librdkafka.
|
10
|
+
|
3
11
|
## 2.4.4 (2024-07-04)
|
4
12
|
- [Enhancement] Allow for offset storing from the Filtering API.
|
5
13
|
- [Enhancement] Print more extensive error info on forceful shutdown.
|
data/Gemfile.lock
CHANGED
data/docker-compose.yml
CHANGED
@@ -121,8 +121,8 @@ module Karafka
|
|
121
121
|
kafka = Setup::AttributesMap.consumer(@topics.first.kafka.dup)
|
122
122
|
|
123
123
|
inject_group_instance_id(kafka)
|
124
|
+
inject_client_id(kafka)
|
124
125
|
|
125
|
-
kafka[:'client.id'] ||= client_id
|
126
126
|
kafka[:'group.id'] ||= @consumer_group.id
|
127
127
|
kafka[:'auto.offset.reset'] ||= @topics.first.initial_offset
|
128
128
|
# Karafka manages the offsets based on the processing state, thus we do not rely on the
|
@@ -132,6 +132,26 @@ module Karafka
|
|
132
132
|
kafka
|
133
133
|
end
|
134
134
|
|
135
|
+
# Sets (if needed) the client.id attribute
|
136
|
+
#
|
137
|
+
# @param kafka [Hash] kafka level config
|
138
|
+
def inject_client_id(kafka)
|
139
|
+
# If client id is set directly on librdkafka level, we do nothing and just go with what
|
140
|
+
# end user has configured
|
141
|
+
return if kafka.key?(:'client.id')
|
142
|
+
|
143
|
+
# This mitigates an issue for multiplexing and potentially other cases when running
|
144
|
+
# multiple karafka processes on one machine, where librdkafka goes into an infinite
|
145
|
+
# loop when using cooperative-sticky and upscaling.
|
146
|
+
#
|
147
|
+
# @see https://github.com/confluentinc/librdkafka/issues/4783
|
148
|
+
kafka[:'client.id'] = if kafka[:'partition.assignment.strategy'] == 'cooperative-sticky'
|
149
|
+
"#{client_id}/#{Time.now.to_f}/#{SecureRandom.hex[0..9]}"
|
150
|
+
else
|
151
|
+
client_id
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
135
155
|
# If we use static group memberships, there can be a case, where same instance id would
|
136
156
|
# be set on many subscription groups as the group instance id from Karafka perspective is
|
137
157
|
# set per config. Each instance even if they are subscribed to different topics needs to
|
data/lib/karafka/setup/config.rb
CHANGED
@@ -385,9 +385,6 @@ module Karafka
|
|
385
385
|
config.kafka[key] = value
|
386
386
|
end
|
387
387
|
|
388
|
-
# Use Karafka client_id as kafka client id if not set
|
389
|
-
config.kafka[:'client.id'] ||= config.client_id
|
390
|
-
|
391
388
|
return if Karafka::App.env.production?
|
392
389
|
|
393
390
|
KAFKA_DEV_DEFAULTS.each do |key, value|
|
data/lib/karafka/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: karafka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maciej Mensfeld
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
AnG1dJU+yL2BK7vaVytLTstJME5mepSZ46qqIJXMuWob/YPDmVaBF39TDSG9e34s
|
36
36
|
msG3BiCqgOgHAnL23+CN3Rt8MsuRfEtoTKpJVcCfoEoNHOkc
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2024-07-
|
38
|
+
date: 2024-07-18 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: base64
|
metadata.gz.sig
CHANGED
Binary file
|