karafka 1.2.0.beta3 → 1.2.0.beta4

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: cf35bab1fc0751c78111ae2e82810b10113e0b7e9bfbf014c32f6239b4725b91
4
- data.tar.gz: e908c0c6e02d3753b53844f993230cd924ecf09b453ec094550f3f81b6741d5d
3
+ metadata.gz: e7df4ccab5fe5e942f4d97bdcb099ed1f754e3902c52775f9272e0f351c879ff
4
+ data.tar.gz: 73417de830c717ab59a74375091d45c43308c58b43fd00bdc7bd579b6f2ded6b
5
5
  SHA512:
6
- metadata.gz: '095c023b08f013114e21e891f8b97a6e3ab9b0aad5dd640948d766474adff7e04f13dd110fa72abf7e671e1996c8b618bbd0bb30093ae8fe4d1dfa41993aa245'
7
- data.tar.gz: d096b0ff330e49dd2fad6ca474f7efd6703b6b8fcfef0eaee6d9064b961a319bd92b0b800eab3529cb43ce2912e372f2d2d549f15bbc7726253ae9f5acaa9893
6
+ metadata.gz: 37cfeeb29cf0728d21e1dcd269c0432ec972bd6cc0b08f690fa49c3e2026ab2b8d2c558229c227dded52ee8a631859a17757422041fdce3ad424993573a5e6ac
7
+ data.tar.gz: 85061228901bdced44d5cf699d10ceb51a0bc818d39fdbcbd1f24b667d75d459f405262ca9036e63357637850d7084da8e71429808e6fd6f094cfbb82f581f05
data/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Karafka framework changelog
2
2
 
3
- ## 1.2.0
3
+ ## 1.2.0.beta4
4
4
  - Spec improvements
5
5
  - #260 - Specs missing randomization
6
6
  - #251 - Shutdown upon non responding (unreachable) cluster is not possible
@@ -34,6 +34,7 @@
34
34
  - Renamed ```after_fetched``` to ```after_fetch``` to normalize the naming convention
35
35
  - Instrumentation on a connection delegator level
36
36
  - Added ```params_batch#last``` method to retrieve last element after unparsing
37
+ - All params keys are now strings
37
38
 
38
39
  ## 1.1.2
39
40
  - #256 - Default kafka.seed_brokers configuration is created in invalid format
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka (1.2.0.beta3)
4
+ karafka (1.2.0.beta4)
5
5
  activesupport (>= 4.0)
6
6
  dry-configurable (~> 0.7)
7
7
  dry-inflector (~> 0.1.1)
@@ -10,7 +10,7 @@ PATH
10
10
  envlogic (~> 1.0)
11
11
  multi_json (>= 1.12)
12
12
  rake (>= 11.3)
13
- require_all (~> 2.0)
13
+ require_all (>= 1.4)
14
14
  ruby-kafka (>= 0.5.3)
15
15
  thor (~> 0.19)
16
16
  waterdrop (~> 1.2)
data/karafka.gemspec CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency 'envlogic', '~> 1.0'
25
25
  spec.add_dependency 'multi_json', '>= 1.12'
26
26
  spec.add_dependency 'rake', '>= 11.3'
27
- spec.add_dependency 'require_all', '~> 2.0'
27
+ spec.add_dependency 'require_all', '>= 1.4'
28
28
  spec.add_dependency 'ruby-kafka', '>= 0.5.3'
29
29
  spec.add_dependency 'thor', '~> 0.19'
30
30
  spec.add_dependency 'waterdrop', '~> 1.2'
@@ -14,9 +14,8 @@ module Karafka
14
14
  # heavy-parsing data without slowing down the whole application.
15
15
  module Dsl
16
16
  # Params keys that are "our" and internal. We use this list for additional backends
17
- # that don't allow symbols to be transferred, to remap the interchanged params
18
- # back into a valid form
19
- SYSTEM_KEYS = %i[
17
+ # that somehow operatae on those keys
18
+ SYSTEM_KEYS = %w[
20
19
  parser
21
20
  value
22
21
  partition
@@ -33,7 +32,7 @@ module Karafka
33
32
  # Kafka passes internally Kafka::FetchedMessage object and the ruby-kafka consumer
34
33
  # uses those fields via method calls, so in order to be able to pass there our params
35
34
  # objects, have to have same api.
36
- METHOD_ATTRIBUTES = %i[
35
+ METHOD_ATTRIBUTES = %w[
37
36
  topic
38
37
  partition
39
38
  offset
@@ -60,21 +59,24 @@ module Karafka
60
59
  # Karafka::Params::Params.build(message) #=> params object
61
60
  def build(message, parser)
62
61
  instance = new
63
- instance[:parser] = parser
62
+ instance['parser'] = parser
64
63
 
65
64
  # Non kafka fetched message can happen when we interchange data with an
66
65
  # additional backend
67
66
  if message.is_a?(Kafka::FetchedMessage)
68
- instance[:value] = message.value
69
- instance[:partition] = message.partition
70
- instance[:offset] = message.offset
71
- instance[:key] = message.key
72
- instance[:create_time] = message.create_time
73
- instance[:receive_time] = Time.now
74
- # When we get raw messages, they might have a topic, that was modified by a
75
- # topic mapper. We need to "reverse" this change and map back to the non-modified
76
- # format, so our internal flow is not corrupted with the mapping
77
- instance[:topic] = Karafka::App.config.topic_mapper.incoming(message.topic)
67
+ instance.send(
68
+ :merge!,
69
+ 'value' => message.value,
70
+ 'partition' => message.partition,
71
+ 'offset' => message.offset,
72
+ 'key' => message.key,
73
+ 'create_time' => message.create_time,
74
+ 'receive_time' => Time.now,
75
+ # When we get raw messages, they might have a topic, that was modified by a
76
+ # topic mapper. We need to "reverse" this change and map back to the non-modified
77
+ # format, so our internal flow is not corrupted with the mapping
78
+ 'topic' => Karafka::App.config.topic_mapper.incoming(message.topic)
79
+ )
78
80
  else
79
81
  instance.send(:merge!, message)
80
82
  end
@@ -88,10 +90,10 @@ module Karafka
88
90
  # to the current object. This object will be also marked as already parsed, so we won't
89
91
  # parse it again.
90
92
  def retrieve!
91
- return self if self[:parsed]
92
- self[:parsed] = true
93
+ return self if self['parsed']
94
+ self['parsed'] = true
93
95
 
94
- merge!(parse(delete(:value)))
96
+ merge!(parse(delete('value')))
95
97
  end
96
98
 
97
99
  # Includes and extends the base params klass with everything that is needed by Karafka to
@@ -143,7 +145,7 @@ module Karafka
143
145
  # went wrong during parsing
144
146
  def parse(value)
145
147
  Karafka.monitor.instrument('params.params.parse', caller: self) do
146
- self[:parser].parse(value)
148
+ self['parser'].parse(value)
147
149
  end
148
150
  rescue ::Karafka::Errors::ParserError => e
149
151
  Karafka.monitor.instrument('params.params.parse.error', caller: self, error: e)
@@ -3,5 +3,5 @@
3
3
  # Main module namespace
4
4
  module Karafka
5
5
  # Current Karafka version
6
- VERSION = '1.2.0.beta3'
6
+ VERSION = '1.2.0.beta4'
7
7
  end
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: 1.2.0.beta3
4
+ version: 1.2.0.beta4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -128,16 +128,16 @@ dependencies:
128
128
  name: require_all
129
129
  requirement: !ruby/object:Gem::Requirement
130
130
  requirements:
131
- - - "~>"
131
+ - - ">="
132
132
  - !ruby/object:Gem::Version
133
- version: '2.0'
133
+ version: '1.4'
134
134
  type: :runtime
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  requirements:
138
- - - "~>"
138
+ - - ">="
139
139
  - !ruby/object:Gem::Version
140
- version: '2.0'
140
+ version: '1.4'
141
141
  - !ruby/object:Gem::Dependency
142
142
  name: ruby-kafka
143
143
  requirement: !ruby/object:Gem::Requirement