File tree 5 files changed +19
-13
lines changed
5 files changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
13
13
14
14
### Fixed
15
15
16
+ ## [ 2.3.1] - 2024-06-05
17
+
18
+ ### Fixed
19
+
20
+ - Rename from ` export_batch ` to ` process_batch `
21
+
16
22
## [ 2.3.0] - 2024-05-30
17
23
18
24
### Added
Original file line number Diff line number Diff line change @@ -233,14 +233,14 @@ require_relative "config/environment"
233
233
some-extra-configuration
234
234
` ` `
235
235
236
- # ## `Export batch`
236
+ # ## `Process batch`
237
237
238
- To process messages in batches, you need to add the `export_batch ` method in the consumer
238
+ To process messages in batches, you need to add the `process_batch ` method in the consumer
239
239
240
240
` ` ` ruby
241
241
# app/consumers/some_consumer.rb
242
242
class SomeConsumer < Sbmt::KafkaConsumer::BaseConsumer
243
- def export_batch (messages)
243
+ def process_batch (messages)
244
244
# some code
245
245
end
246
246
end
Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ def self.name
17
17
18
18
def consume
19
19
::Rails . application . executor . wrap do
20
- if export_batch ?
20
+ if process_batch ?
21
21
with_batch_instrumentation ( messages ) do
22
- export_batch ( messages )
22
+ process_batch ( messages )
23
23
mark_as_consumed! ( messages . last )
24
24
end
25
25
else
@@ -30,11 +30,11 @@ def consume
30
30
end
31
31
end
32
32
33
- def export_batch ?
34
- if @export_batch_memoized . nil?
35
- @export_batch_memoized = respond_to? ( :export_batch )
33
+ def process_batch ?
34
+ if @process_batch_memoized . nil?
35
+ @process_batch_memoized = respond_to? ( :process_batch )
36
36
end
37
- @export_batch_memoized
37
+ @process_batch_memoized
38
38
end
39
39
40
40
private
Original file line number Diff line number Diff line change 2
2
3
3
module Sbmt
4
4
module KafkaConsumer
5
- VERSION = "2.3.0 "
5
+ VERSION = "2.3.1 "
6
6
end
7
7
end
Original file line number Diff line number Diff line change @@ -97,8 +97,8 @@ def process_message(_message)
97
97
let ( :consumer_class ) do
98
98
Class . new ( described_class . consumer_klass ) do
99
99
attr_reader :consumed
100
- def export_batch ( messages )
101
- Rails . logger . info "Export batch #{ messages . count } messages"
100
+ def process_batch ( messages )
101
+ Rails . logger . info "Process batch #{ messages . count } messages"
102
102
@consumed = true
103
103
end
104
104
@@ -119,7 +119,7 @@ def consumed?
119
119
it "consumes" do
120
120
consume_with_sbmt_karafka
121
121
expect ( consumer ) . to be_consumed
122
- expect ( Rails . logger ) . to have_received ( :info ) . with ( /Export batch/ )
122
+ expect ( Rails . logger ) . to have_received ( :info ) . with ( /Process batch/ )
123
123
end
124
124
end
125
125
end
You can’t perform that action at this time.
0 commit comments