nulogy_message_bus_consumer 2.0.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,8 @@ RSpec.describe "Auditing pipeline" do # rubocop:disable RSpec/DescribeClass
4
4
  NulogyMessageBusConsumer::Config.new(
5
5
  consumer_group_id: random_consumer_group,
6
6
  bootstrap_servers: test_bootstrap_servers,
7
- topic_name: topic.topic_name
7
+ topic_name: topic.topic_name,
8
+ security_protocol: "plaintext"
8
9
  )
9
10
  end
10
11
  let(:logger) { spy }
@@ -33,7 +34,7 @@ RSpec.describe "Auditing pipeline" do # rubocop:disable RSpec/DescribeClass
33
34
 
34
35
  run_audit_pipeline
35
36
 
36
- expect(logger).to have_not_received(:warn)
37
+ expect(logger).not_to receive(:warn)
37
38
  end
38
39
  end
39
40
 
@@ -44,10 +44,9 @@ RSpec.describe NulogyMessageBusConsumer::Steps::CommitOnSuccess do
44
44
  it "reprocesses the message" do
45
45
  create_topic(test_topic.topic_name)
46
46
 
47
- expect(handler).to receive(:call).with(a_message_with(key: "test 1")).and_return(:failure)
48
- expect(handler).to receive(:call).with(a_message_with(key: "test 1")).and_return(:success)
47
+ expect(handler).to receive(:call).with(a_message_with(key: "test 1")).and_return(:failure, :success)
49
48
  expect(handler).to receive(:call).with(a_message_with(key: "test 2")).and_return(:success)
50
- expect(consumer).to receive(:commit).twice
49
+ expect(consumer).to receive(:commit).twice.and_call_original
51
50
 
52
51
  test_topic.produce_one_message(key: "test 1")
53
52
  test_topic.produce_one_message(key: "test 2")
@@ -86,7 +85,7 @@ RSpec.describe NulogyMessageBusConsumer::Steps::CommitOnSuccess do
86
85
  expect(handler).to receive(:call).with(a_message_with(key: "test 1")).and_raise("intentional error")
87
86
  expect(handler).to receive(:call).with(a_message_with(key: "test 1")).and_return(:success)
88
87
  expect(handler).to receive(:call).with(a_message_with(key: "test 2")).and_return(:success)
89
- expect(consumer).to receive(:commit).twice
88
+ expect(consumer).to receive(:commit).twice.and_call_original
90
89
 
91
90
  test_topic.produce_one_message(key: "test 1")
92
91
  test_topic.produce_one_message(key: "test 2")
@@ -34,12 +34,15 @@ module Kafka
34
34
  consumer
35
35
  end
36
36
 
37
+ # TODO: Why is this duplicated from ConnectToMessageBus
37
38
  def kafka_consumer_config
38
39
  config = {
39
40
  "auto.offset.reset": "beginning",
40
41
  "bootstrap.servers": test_bootstrap_servers,
41
42
  "enable.auto.commit": false,
42
- "group.id": random_consumer_group
43
+ "enable.auto.offset.store": false,
44
+ "group.id": random_consumer_group,
45
+ "security.protocol": "plaintext"
43
46
  }
44
47
 
45
48
  Rdkafka::Config.new(config)
@@ -76,7 +79,8 @@ module Kafka
76
79
  NulogyMessageBusConsumer::Config.new(
77
80
  consumer_group_id: random_consumer_group,
78
81
  bootstrap_servers: test_bootstrap_servers,
79
- topic_name: topic_name
82
+ topic_name: topic_name,
83
+ security_protocol: "plaintext"
80
84
  )
81
85
  end
82
86
  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: 2.0.1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nulogy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-17 00:00:00.000000000 Z
11
+ date: 2024-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: bundler-audit
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '='
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.7.0.1
61
+ version: 0.9.2
62
62
  type: :development
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: 0.7.0.1
68
+ version: 0.9.2
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: dotenv
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: pg
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '='
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 1.2.3
89
+ version: '1.2'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '='
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 1.2.3
96
+ version: '1.2'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: pry
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +128,28 @@ dependencies:
128
128
  requirements:
129
129
  - - '='
130
130
  - !ruby/object:Gem::Version
131
- version: 6.0.3.5
131
+ version: 6.0.4
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - '='
137
137
  - !ruby/object:Gem::Version
138
- version: 6.0.3.5
138
+ version: 6.0.4
139
+ - !ruby/object:Gem::Dependency
140
+ name: psych
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "<"
144
+ - !ruby/object:Gem::Version
145
+ version: '4'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "<"
151
+ - !ruby/object:Gem::Version
152
+ version: '4'
139
153
  - !ruby/object:Gem::Dependency
140
154
  name: rspec
141
155
  requirement: !ruby/object:Gem::Requirement
@@ -299,6 +313,7 @@ files:
299
313
  - spec/dummy/config/spring.rb
300
314
  - spec/dummy/config/storage.yml
301
315
  - spec/dummy/db/schema.rb
316
+ - spec/dummy/log/development.log
302
317
  - spec/dummy/log/test.log
303
318
  - spec/dummy/public/404.html
304
319
  - spec/dummy/public/422.html
@@ -349,7 +364,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
349
364
  - !ruby/object:Gem::Version
350
365
  version: '0'
351
366
  requirements: []
352
- rubygems_version: 3.2.22
367
+ rubygems_version: 3.4.19
353
368
  signing_key:
354
369
  specification_version: 4
355
370
  summary: Code for accessing the Nulogy Message Bus
@@ -397,6 +412,7 @@ test_files:
397
412
  - spec/dummy/config/storage.yml
398
413
  - spec/dummy/config.ru
399
414
  - spec/dummy/db/schema.rb
415
+ - spec/dummy/log/development.log
400
416
  - spec/dummy/log/test.log
401
417
  - spec/dummy/public/404.html
402
418
  - spec/dummy/public/422.html