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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c2ef8a36c5d0ba49ef96b39045cada64669993cd7f627951199ffaee2413c0cb
4
- data.tar.gz: 63bb5a74cc469511876d7443be41ee0fab4b43782b394e469cc8fc724f82ed3e
3
+ metadata.gz: 2faa5c725b717d217b37a0c9019ecd3f3ae9d40885a2e3b1ce898e626bbb2d3c
4
+ data.tar.gz: 865137198c57cfd60bdea31c482a66240a284c34d4f1149033160c28fb2a6cef
5
5
  SHA512:
6
- metadata.gz: d1c99f7925a176c7d4e0637c4fb95cfe88768c76bc316352b2ac829758c79c6e765c6c051256a8b46cc9ffdb16e310ed5d46fc9aa33460ebd96073fd59509e8e
7
- data.tar.gz: 683efad3187b13a70d88bb13ebe84e1ce44509a2f64a4324014d521e331df2d50baac5718e8758d93700eaf73e19e1251985784bace259e30fd7fc1fa3fc0438
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
- require "bundler/gem_tasks"
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
@@ -59,4 +59,4 @@ module NulogyMessageBusConsumer
59
59
  Handlers::LogUnprocessedMessages.new(logger)
60
60
  ])
61
61
  end
62
- end
62
+ end
@@ -58,4 +58,4 @@ module NulogyMessageBusConsumer
58
58
  BEGINNING_OFFSET = 0
59
59
  END_OFFSET = -1
60
60
  end
61
- end
61
+ 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 :public_subscription_id
13
- attr_reader :tenant_id
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: envelope_data[:event_json],
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
- public_subscription_id: envelope_data[:public_subscription_id],
27
- tenant_id: envelope_data[:tenant_id],
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
  )
@@ -6,4 +6,4 @@ module NulogyMessageBusConsumer
6
6
 
7
7
  def warn(*_) end
8
8
  end
9
- end
9
+ end
@@ -38,4 +38,4 @@ module NulogyMessageBusConsumer
38
38
  end
39
39
  end
40
40
  end
41
- end
41
+ end
@@ -1,3 +1,3 @@
1
1
  module NulogyMessageBusConsumer
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
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.2.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-07-14 00:00:00.000000000 Z
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