nulogy_message_bus_consumer 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +10 -1
- data/lib/nulogy_message_bus_consumer.rb +1 -1
- data/lib/nulogy_message_bus_consumer/kafka_utils.rb +1 -1
- data/lib/nulogy_message_bus_consumer/message.rb +8 -5
- data/lib/nulogy_message_bus_consumer/null_logger.rb +1 -1
- data/lib/nulogy_message_bus_consumer/pipeline.rb +1 -1
- data/lib/nulogy_message_bus_consumer/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2faa5c725b717d217b37a0c9019ecd3f3ae9d40885a2e3b1ce898e626bbb2d3c
|
4
|
+
data.tar.gz: 865137198c57cfd60bdea31c482a66240a284c34d4f1149033160c28fb2a6cef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82c5cf164680d27183b17b341b362c5f1ec70a26fecf79d4f8d982ea3506e107ac8e216604c5182469c627892f3c423336053a2502c8e10c574c85af5dd82402
|
7
|
+
data.tar.gz: d2109e0aefef9eecebfb57425316cf36dd7cdb92a4356253efb73271f2fed5e4c1ed59e56a46b44a2dc869dd3acb5285b88ae11d6d72b15f50a7506ed85058a2
|
data/Rakefile
CHANGED
@@ -18,4 +18,13 @@ APP_RAKEFILE = File.expand_path("spec/dummy/Rakefile", __dir__)
|
|
18
18
|
load "rails/tasks/engine.rake"
|
19
19
|
load "rails/tasks/statistics.rake"
|
20
20
|
|
21
|
-
|
21
|
+
RSpec::Core::RakeTask.new(:spec)
|
22
|
+
require "rubocop/rake_task"
|
23
|
+
RuboCop::RakeTask.new
|
24
|
+
task default: [:spec, :rubocop]
|
25
|
+
|
26
|
+
require "rake/release"
|
27
|
+
|
28
|
+
Rake::Release::Task.load_all do |spec|
|
29
|
+
spec.version_tag = "nulogy_message_bus_producer-v#{spec.version}"
|
30
|
+
end
|
@@ -5,26 +5,29 @@ module NulogyMessageBusConsumer
|
|
5
5
|
end
|
6
6
|
|
7
7
|
attr_reader :event_data
|
8
|
+
attr_reader :event_data_unparsed
|
8
9
|
attr_reader :id
|
9
10
|
attr_reader :key
|
10
11
|
attr_reader :offset
|
11
12
|
attr_reader :partition
|
12
|
-
attr_reader :
|
13
|
-
attr_reader :
|
13
|
+
attr_reader :subscription_id
|
14
|
+
attr_reader :company_uuid
|
14
15
|
attr_reader :timestamp
|
15
16
|
attr_reader :topic
|
16
17
|
|
17
18
|
def self.from_kafka(kafka_message)
|
18
19
|
envelope_data = JSON.parse(kafka_message.payload, symbolize_names: true)
|
20
|
+
event_data = JSON.parse(envelope_data[:event_json], symbolize_names: true) rescue {}
|
19
21
|
|
20
22
|
new(
|
21
|
-
event_data:
|
23
|
+
event_data: event_data,
|
24
|
+
event_data_unparsed: envelope_data[:event_json],
|
22
25
|
id: envelope_data[:id],
|
23
26
|
key: kafka_message.key,
|
24
27
|
offset: kafka_message.offset,
|
25
28
|
partition: kafka_message.partition,
|
26
|
-
|
27
|
-
|
29
|
+
subscription_id: envelope_data[:subscription_id] || envelope_data[:public_subscription_id],
|
30
|
+
company_uuid: envelope_data[:company_uuid] || envelope_data[:tenant_id],
|
28
31
|
timestamp: kafka_message.timestamp,
|
29
32
|
topic: kafka_message.topic,
|
30
33
|
)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nulogy_message_bus_consumer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nulogy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 6.0.3
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake-release
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.2.1
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.2.1
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: rspec
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|