nulogy_message_bus_consumer 0.3.2 → 0.3.3

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: 06d80940b2a655a32c8835712e4b05d1c11e03842906838bc41747387b29fe9c
4
- data.tar.gz: 97088e64abcb4ce26caf0dd6e1152c40d94c7c3ef6cff5e5934724ab2ee3b72c
3
+ metadata.gz: c47fb7fab95cd7d64e9654c0ce43fec64f77f8718331f8028afc6c18ab993f81
4
+ data.tar.gz: 3c656a7dea18d149f04ccfbc3dc4db04e9aa7b3cd6183be7b0a1a45337c3a975
5
5
  SHA512:
6
- metadata.gz: b29bbf882128c1c4d47b91a4929de09e254e6428648504b3dc14a29e7e16d43c5d22ccb0c9ea0fd87b7b062c76446ad13ad8dae39d17f96bf02ae19423c09099
7
- data.tar.gz: '095efec4ae0cba16311a8f97b9c2f0db81642875fb50dccc32aebb3e3b7e287f2761826bb7197aca3004f821d06a6606e6d0f07956853b3f32cd34d4faf0bd1c'
6
+ metadata.gz: 04320f62a752bcfcc4bad93bd0611ba0f8945018dfb1680016ab739b70ba66cb7ebcf5062fb12f316745e59386714613c44f17f7feea4006a56b8625da119e23
7
+ data.tar.gz: c480ced5fb50feeb8d655cb8c0b45c19a12bd733088db6fe4bf78ce33d08a7051594eb86a011227d2cc1363ea058e1544435c318824a6c9549be2e32fb6f65ef
@@ -0,0 +1 @@
1
+ dfa19863b2709390893da4c2fb85579a
@@ -0,0 +1 @@
1
+ /WXdqUYePaHqAq3P0iTEsrLiMfRKzp2qYYh7K+q6LUNgi4eHNv0+SoLdI1bUNb9UaGvDPGNT3fCwAdkurk5Iud16ok3b4wD6yZ7UkfqbXqZaKH/dciQ5s63p9Hiuq1rbfcqoZ3KR1SXYAwvy8vNqbdwbAzz2N66B1wE5fNibZZlrWzXJjLReiTcNyxNbCPz6vwEwFF52RntuYlIJo4Nkm8vEk3No+HWrOkM8xptr5qApbd+RowLCLZ4/kcAMDB/XPiGobf0AOFv1NUR/9ChEy20usa8Fqd6HtEn4A25HnAC0uaN0K8ZRXjxhMpnXtfMBItn7yxyJ1ubjRZK5a1xVBRU7L/CVV9ZuIsqAHL1++gH5FBrEe83ZIUhN7AzngMDlOPKGiCLiZLrm18I1AEQrD7tJLyXos15AeAzj--cER8cN0iMLwu8Le+--FL7dhMTgr6xL6SkMnYKmeg==
@@ -1,12 +1,13 @@
1
1
  module NulogyMessageBusConsumer
2
2
  module Steps
3
3
  class CommitOnSuccess
4
- def call(kafka_consumer:, **_)
4
+ def call(kafka_consumer:, message:, **_)
5
5
  result = yield
6
6
 
7
7
  raise_if_invalid(result)
8
8
 
9
9
  if result == :success
10
+ kafka_consumer.store_offset(message)
10
11
  kafka_consumer.commit
11
12
  else
12
13
  reconnect_to_reprocess_same_message(kafka_consumer)
@@ -32,6 +32,7 @@ module NulogyMessageBusConsumer
32
32
  "bootstrap.servers": @config.bootstrap_servers,
33
33
  "enable.auto.commit": false,
34
34
  "group.id": @config.consumer_group_id,
35
+ "enable.auto.offset.store": false,
35
36
  }
36
37
  end
37
38
  end
@@ -1,3 +1,3 @@
1
1
  module NulogyMessageBusConsumer
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
@@ -1,16 +1,15 @@
1
1
  namespace :message_bus_consumer do
2
2
  desc "Verifies that the messages in the message bus have been processed"
3
3
  task audit: :environment do
4
- config = build_audit_config
4
+ logger = Rails.logger
5
+ config = NulogyMessageBusConsumer::Config.new(
6
+ consumer_group_id: ENV.fetch("MB_AUDIT_GROUP"),
7
+ bootstrap_servers: ENV.fetch("MB_BOOTSTRAP_SERVERS"),
8
+ topic_name: ENV.fetch("MB_CONSUMER_TOPIC")
9
+ )
5
10
 
6
11
  NulogyMessageBusConsumer
7
- .consumer_audit_pipeline(config: config)
12
+ .consumer_audit_pipeline(config: config, logger: logger)
8
13
  .invoke
9
14
  end
10
-
11
- def build_audit_config
12
- audit_config = NulogyMessageBusConsumer.config.dup
13
- audit_config.consumer_group_id = "#{audit_config.consumer_group_id}_consumer_audit"
14
- NulogyMessageBusConsumer.config
15
- end
16
15
  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.3.2
4
+ version: 0.3.3
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-12 00:00:00.000000000 Z
11
+ date: 2020-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -52,6 +52,34 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler-audit
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 0.7.0.1
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '='
67
+ - !ruby/object:Gem::Version
68
+ version: 0.7.0.1
69
+ - !ruby/object:Gem::Dependency
70
+ name: dotenv
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '='
74
+ - !ruby/object:Gem::Version
75
+ version: 2.7.6
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '='
81
+ - !ruby/object:Gem::Version
82
+ version: 2.7.6
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: pg
57
85
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +128,14 @@ dependencies:
100
128
  requirements:
101
129
  - - '='
102
130
  - !ruby/object:Gem::Version
103
- version: 6.0.3
131
+ version: 6.0.3.1
104
132
  type: :development
105
133
  prerelease: false
106
134
  version_requirements: !ruby/object:Gem::Requirement
107
135
  requirements:
108
136
  - - '='
109
137
  - !ruby/object:Gem::Version
110
- version: 6.0.3
138
+ version: 6.0.3.1
111
139
  - !ruby/object:Gem::Dependency
112
140
  name: rake-release
113
141
  requirement: !ruby/object:Gem::Requirement
@@ -214,6 +242,8 @@ extensions: []
214
242
  extra_rdoc_files: []
215
243
  files:
216
244
  - Rakefile
245
+ - config/credentials/message-bus-us-east-1.key
246
+ - config/credentials/message-bus-us-east-1.yml.enc
217
247
  - config/routes.rb
218
248
  - db/migrate/20200509095105_create_message_bus_processed_messages.rb
219
249
  - lib/nulogy_message_bus_consumer.rb