rimless 1.0.4 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Makefile +5 -1
- data/lib/rimless/consumer.rb +1 -1
- data/lib/rimless/karafka/avro_deserializer.rb +7 -3
- data/lib/rimless/karafka/base64_interchanger.rb +5 -5
- data/lib/rimless/version.rb +1 -1
- data/rimless.gemspec +3 -3
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8731817c3b1148a4a9c5954f89cbc2a6a1f5c9e7023137be662d2405260cfc0
|
4
|
+
data.tar.gz: 731e88cf5b51713d89178dd7e17b5ec180ed3644f7359a6dc70994d2f2dfd5f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 470445e7954d1c51c815c98988a87fe2e8b520b53ccdc36cd77ae8380ed0756ec89c181f338e646cd5f472b2cf9fd249b259d1f34713f7ec6e71a0486bd4d27b
|
7
|
+
data.tar.gz: bb8c86c2aece00aa3c6e38ebb96847bf33059f60cab1e163d92cc8ae8fb077bb000423b977243214df5c3d45691e3bad48a62ebb811b4783d6f1a4688abf256e
|
data/CHANGELOG.md
CHANGED
data/Makefile
CHANGED
@@ -85,7 +85,11 @@ update: install
|
|
85
85
|
@$(MKDIR) -p $(VENDOR_DIR)
|
86
86
|
@$(call run-shell,$(BUNDLE) exec $(APPRAISAL) update)
|
87
87
|
|
88
|
-
test:
|
88
|
+
test: \
|
89
|
+
test-specs \
|
90
|
+
test-style
|
91
|
+
|
92
|
+
test-specs:
|
89
93
|
# Run the whole test suite
|
90
94
|
@$(call run-shell,$(BUNDLE) exec $(RAKE))
|
91
95
|
|
data/lib/rimless/consumer.rb
CHANGED
@@ -6,15 +6,19 @@ module Rimless
|
|
6
6
|
class AvroDeserializer
|
7
7
|
# Deserialize an Apache Avro encoded Apache Kafka message.
|
8
8
|
#
|
9
|
-
# @param
|
9
|
+
# @param params [Karafka::Params::Params] the Karafka message parameters
|
10
10
|
# @return [Hash{Symbol => Mixed}] the deserialized Apache Avro message
|
11
|
-
def call(
|
11
|
+
def call(params)
|
12
|
+
# When the Kafka message does not have a payload, we won't fail.
|
13
|
+
# This is for Kafka users which use log compaction with a nil payload.
|
14
|
+
return if params.raw_payload.nil?
|
15
|
+
|
12
16
|
# We use sparsed hashes inside of Apache Avro messages for schema-less
|
13
17
|
# blobs of data, such as loosely structured metadata blobs. Thats a
|
14
18
|
# somewhat bad idea on strictly typed and defined messages, but their
|
15
19
|
# occurence should be rare.
|
16
20
|
Rimless
|
17
|
-
.decode(
|
21
|
+
.decode(params.raw_payload)
|
18
22
|
.yield_self { |data| Sparsify(data, sparse_array: true) }
|
19
23
|
.yield_self { |data| data.transform_keys { |key| key.delete('\\') } }
|
20
24
|
.yield_self { |data| Unsparsify(data, sparse_array: true) }
|
@@ -7,14 +7,14 @@ module Rimless
|
|
7
7
|
#
|
8
8
|
# rubocop:disable Security/MarshalLoad because we encode/decode the
|
9
9
|
# messages in our own controlled context
|
10
|
-
class Base64Interchanger
|
10
|
+
class Base64Interchanger < ::Karafka::Interchanger
|
11
11
|
# Encode a binary Apache Kafka message(s) so they can be passed to the
|
12
12
|
# Sidekiq +Rimless::ConsumerJob+.
|
13
13
|
#
|
14
14
|
# @param params_batch [Mixed] the raw message(s) to encode
|
15
15
|
# @return [String] the marshaled+base64 encoded data
|
16
|
-
def
|
17
|
-
Base64.encode64(Marshal.dump(
|
16
|
+
def encode(params_batch)
|
17
|
+
Base64.encode64(Marshal.dump(super))
|
18
18
|
end
|
19
19
|
|
20
20
|
# Decode the binary Apache Kafka message(s) so they can be processed by
|
@@ -22,8 +22,8 @@ module Rimless
|
|
22
22
|
#
|
23
23
|
# @param params_string [String] the marshaled+base64 encoded data
|
24
24
|
# @return [Mixed] the unmarshaled+base64 decoded data
|
25
|
-
def
|
26
|
-
Marshal.load(Base64.decode64(
|
25
|
+
def decode(params_string)
|
26
|
+
Marshal.load(Base64.decode64(super)).map(&:stringify_keys)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
# rubocop:enable Security/MarshalLoad
|
data/lib/rimless/version.rb
CHANGED
data/rimless.gemspec
CHANGED
@@ -25,9 +25,9 @@ Gem::Specification.new do |spec|
|
|
25
25
|
|
26
26
|
spec.add_runtime_dependency 'activesupport', '>= 4.2.0'
|
27
27
|
spec.add_runtime_dependency 'avro_turf', '~> 0.11.0'
|
28
|
-
spec.add_runtime_dependency 'karafka', '~> 1.
|
29
|
-
spec.add_runtime_dependency 'karafka-sidekiq-backend', '~> 1.
|
30
|
-
spec.add_runtime_dependency 'karafka-testing', '~> 1.
|
28
|
+
spec.add_runtime_dependency 'karafka', '~> 1.4'
|
29
|
+
spec.add_runtime_dependency 'karafka-sidekiq-backend', '~> 1.4'
|
30
|
+
spec.add_runtime_dependency 'karafka-testing', '~> 1.4'
|
31
31
|
spec.add_runtime_dependency 'sinatra'
|
32
32
|
spec.add_runtime_dependency 'sparsify', '~> 1.1'
|
33
33
|
spec.add_runtime_dependency 'waterdrop', '~> 1.2'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rimless
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hermann Mayer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -44,42 +44,42 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '1.
|
47
|
+
version: '1.4'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '1.
|
54
|
+
version: '1.4'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: karafka-sidekiq-backend
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '1.
|
61
|
+
version: '1.4'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '1.
|
68
|
+
version: '1.4'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: karafka-testing
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '1.
|
75
|
+
version: '1.4'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '1.
|
82
|
+
version: '1.4'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: sinatra
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -433,7 +433,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
433
433
|
- !ruby/object:Gem::Version
|
434
434
|
version: '0'
|
435
435
|
requirements: []
|
436
|
-
rubygems_version: 3.1.
|
436
|
+
rubygems_version: 3.1.4
|
437
437
|
signing_key:
|
438
438
|
specification_version: 4
|
439
439
|
summary: A bundle of opinionated Apache Kafka / Confluent Schema Registry helpers.
|