karafka 2.0.0.alpha3 → 2.0.0.alpha4

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: 4e715fa7f45c40a200fc2d281d765f5d42ac4f03ba6e3f529b86a0adc90bc1af
4
- data.tar.gz: 50e2083063f1fd77ffc529395550e443c4166aa035c2d87716390059bec6fe32
3
+ metadata.gz: f8ed5005d3288abb4f9f6389fa126b5434b5a7a6df729e924695d38624e167e5
4
+ data.tar.gz: aa802a441d9c9cb1275260ba9b290c8c4c72acf125ca72efaafc58538a6c8b20
5
5
  SHA512:
6
- metadata.gz: d225ba3d118716bcf1265e06d3d781aee7a3e9e87edaab791fdf1b240dc1565a0a460a3f99ca5b8687f6e63701ff2fee3d8ffe343dc18c5e1bfdde4af9deb852
7
- data.tar.gz: 73084d0b5f3678f37b63debdcf944517e0f954bf0a21242caae3c807ced721afd26f5d6bdb864bcf5fe36bb2d098ca3dd167901a1c3ddc61b0ceb00f8a3a2d96
6
+ metadata.gz: 1ad458acdb42c28d04895db1aa348d0ab10177c0829e7b19fc9fd8b23aaac5fc17feac5e1366cd6444d1e60903b087be1b24298b7764a98f8f372a325afb7cee
7
+ data.tar.gz: fb1de540a2c50d26467585bb720a636726955e65f1cea1ca055ef4a9f10d66db233928ca8b067d225d6c935f779d50f2381660ddcaa0d86d6c5b0b8a8ed991e1
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Karafka framework changelog
2
2
 
3
+ ## 2.0.0-alpha4 (Unreleased)
4
+ - Rails support without ActiveJob queue adapter usage (#805)
5
+
3
6
  ## 2.0.0-alpha3 (2022-03-16)
4
7
  - Restore 'app.initialized' state and add notification on it
5
8
  - Fix the installation flow for Rails and add integration tests for this scenario
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka (2.0.0.alpha3)
4
+ karafka (2.0.0.alpha4)
5
5
  dry-configurable (~> 0.13)
6
6
  dry-monitor (~> 0.5)
7
7
  dry-validation (~> 1.7)
data/bin/integrations CHANGED
@@ -25,7 +25,7 @@ CONCURRENCY = 4
25
25
  class Scenario
26
26
  # How long a scenario can run before we kill it
27
27
  # This is a fail-safe just in case something would hang
28
- MAX_RUN_TIME = 60 * 5
28
+ MAX_RUN_TIME = 60 * 2
29
29
 
30
30
  # There are rare cases where Karafka may force shutdown for some of the integration cases
31
31
  # This includes exactly those
data/bin/stress CHANGED
@@ -9,5 +9,5 @@ set -e
9
9
  while :
10
10
  do
11
11
  reset
12
- bundle exec bin/integrations $1
12
+ bin/integrations $1
13
13
  done
@@ -1,20 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_job'
4
- require 'active_job/queue_adapters'
5
- require 'active_job/queue_adapters/karafka_adapter'
3
+ begin
4
+ require 'active_job'
5
+ require_relative 'queue_adapters/karafka_adapter'
6
6
 
7
- module ActiveJob
8
- # Namespace for usage simplification outside of Rails where Railtie will not kick in.
9
- # That way a require 'active_job/karafka' should be enough to use it
10
- module Karafka
7
+ module ActiveJob
8
+ # Namespace for usage simplification outside of Rails where Railtie will not kick in.
9
+ # That way a require 'active_job/karafka' should be enough to use it
10
+ module Karafka
11
+ end
11
12
  end
12
- end
13
-
14
- # We extend routing builder by adding a simple wrapper for easier jobs topics defining
15
- # This needs to be extended here as it is going to be used in karafka routes, hence doing that in
16
- # the railtie initializer would be too late
17
- ::Karafka::Routing::Builder.include ::Karafka::ActiveJob::RoutingExtensions
18
- ::Karafka::Routing::Proxy.include ::Karafka::ActiveJob::RoutingExtensions
19
13
 
20
- # We extend ActiveJob stuff in the railtie
14
+ # We extend routing builder by adding a simple wrapper for easier jobs topics defining
15
+ # This needs to be extended here as it is going to be used in karafka routes, hence doing that in
16
+ # the railtie initializer would be too late
17
+ ::Karafka::Routing::Builder.include ::Karafka::ActiveJob::RoutingExtensions
18
+ ::Karafka::Routing::Proxy.include ::Karafka::ActiveJob::RoutingExtensions
19
+ rescue LoadError
20
+ # We extend ActiveJob stuff in the railtie
21
+ end
@@ -10,6 +10,7 @@ module Karafka
10
10
  required(:id).filled(:str?, format?: Karafka::Contracts::TOPIC_REGEXP)
11
11
  required(:kafka).filled
12
12
  required(:max_messages) { int? & gteq?(1) }
13
+ required(:initial_offset).filled(included_in?: %w[earliest latest])
13
14
  required(:max_wait_time).filled { int? & gteq?(10) }
14
15
  required(:manual_offset_management).filled(:bool?)
15
16
  required(:name).filled(:str?, format?: Karafka::Contracts::TOPIC_REGEXP)
@@ -41,7 +41,7 @@ module Karafka
41
41
 
42
42
  kafka[:'client.id'] ||= Karafka::App.config.client_id
43
43
  kafka[:'group.id'] ||= @topics.first.consumer_group.id
44
- kafka[:'auto.offset.reset'] ||= 'earliest'
44
+ kafka[:'auto.offset.reset'] ||= @topics.first.initial_offset
45
45
  # Karafka manages the offsets based on the processing state, thus we do not rely on the
46
46
  # rdkafka offset auto-storing
47
47
  kafka[:'enable.auto.offset.store'] = 'false'
@@ -18,6 +18,7 @@ module Karafka
18
18
  kafka
19
19
  max_messages
20
20
  max_wait_time
21
+ initial_offset
21
22
  ].freeze
22
23
 
23
24
  private_constant :DISTRIBUTION_KEYS
@@ -16,6 +16,7 @@ module Karafka
16
16
  manual_offset_management
17
17
  max_messages
18
18
  max_wait_time
19
+ initial_offset
19
20
  ].freeze
20
21
 
21
22
  private_constant :INHERITABLE_ATTRIBUTES
@@ -54,6 +54,9 @@ module Karafka
54
54
  setting :consumer_persistence, default: true
55
55
  # Default deserializer for converting incoming data into ruby objects
56
56
  setting :deserializer, default: Karafka::Serialization::Json::Deserializer.new
57
+ # option [String] should we start with the earliest possible offset or latest
58
+ # This will set the `auto.offset.reset` value unless present in the kafka scope
59
+ setting :initial_offset, default: 'earliest'
57
60
  # option [Boolean] should we leave offset management to the user
58
61
  setting :manual_offset_management, default: false
59
62
  # options max_messages [Integer] how many messages do we want to fetch from Kafka in one go
@@ -3,5 +3,5 @@
3
3
  # Main module namespace
4
4
  module Karafka
5
5
  # Current Karafka version
6
- VERSION = '2.0.0.alpha3'
6
+ VERSION = '2.0.0.alpha4'
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
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.alpha3
4
+ version: 2.0.0.alpha4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -34,7 +34,7 @@ cert_chain:
34
34
  R2P11bWoCtr70BsccVrN8jEhzwXngMyI2gVt750Y+dbTu1KgRqZKp/ECe7ZzPzXj
35
35
  pIy9vHxTANKYVyI4qj8OrFdEM5BQNu8oQpL0iQ==
36
36
  -----END CERTIFICATE-----
37
- date: 2022-03-16 00:00:00.000000000 Z
37
+ date: 2022-03-20 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: dry-configurable
metadata.gz.sig CHANGED
Binary file