sbmt-outbox 6.7.0 → 6.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/config/initializers/active_record.rb +10 -0
- data/lib/generators/helpers/migration.rb +1 -1
- data/lib/sbmt/outbox/engine.rb +5 -0
- data/lib/sbmt/outbox/middleware/execution_context/context_item_process_middleware.rb +19 -0
- data/lib/sbmt/outbox/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d1f4fc3cdedb0f5965cd7f6300aa6ac3535053d94b62dd0b6fb440d542edc4c
|
4
|
+
data.tar.gz: 0bc0039248269d121d003a8175469a316bf87c55b9331765c21b3a2fb7f954b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18d8a5e96cb13869f08fd91ee1f2581cc738d1fe5df7b4532503537d246fa37a15c074db87b7f9e8fe6895c0fc495467eabe9563c5923e0c2220459bde744566
|
7
|
+
data.tar.gz: e15f6f2c0d1bc1b6c6b54e6702dc35a928e124d826d74f1f5fee274d43336db5866a9db6bab3c107354fff8dbdf26a8e89626dfeb66c3e9407de48b456350525
|
data/README.md
CHANGED
@@ -235,7 +235,7 @@ create_table :my_outbox_items do |t|
|
|
235
235
|
end
|
236
236
|
|
237
237
|
add_index :my_outbox_items, :uuid, unique: true
|
238
|
-
add_index :my_outbox_items, [:status, :bucket, :errors_count]
|
238
|
+
add_index :my_outbox_items, [:status, :id, :bucket], algorithm: :concurrently, include: [:errors_count]
|
239
239
|
add_index :my_outbox_items, [:event_name, :event_key, :id]
|
240
240
|
add_index :my_outbox_items, :created_at
|
241
241
|
```
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
if ActiveRecord.version >= Gem::Version.new("7.0.0")
|
4
|
+
Rails.application.config.active_record.tap do |config|
|
5
|
+
config.query_log_tags << {
|
6
|
+
box_name: ->(context) { context[:box_item]&.class&.box_name },
|
7
|
+
box_item_id: ->(context) { context[:box_item]&.uuid }
|
8
|
+
}
|
9
|
+
end
|
10
|
+
end
|
@@ -44,7 +44,7 @@ module Outbox
|
|
44
44
|
end
|
45
45
|
|
46
46
|
add_index :#{table_name}, :uuid, unique: true
|
47
|
-
add_index :#{table_name}, [:status, :bucket, :errors_count]
|
47
|
+
add_index :#{table_name}, [:status, :id, :bucket], algorithm: :concurrently, include: [:errors_count]
|
48
48
|
add_index :#{table_name}, [:event_key, :id]
|
49
49
|
add_index :#{table_name}, :created_at
|
50
50
|
RUBY
|
data/lib/sbmt/outbox/engine.rb
CHANGED
@@ -69,6 +69,11 @@ module Sbmt
|
|
69
69
|
c.batch_process_middlewares.push("Sbmt::Outbox::Middleware::Sentry::TracingBatchProcessMiddleware")
|
70
70
|
c.item_process_middlewares.push("Sbmt::Outbox::Middleware::Sentry::TracingItemProcessMiddleware")
|
71
71
|
end
|
72
|
+
|
73
|
+
if defined?(ActiveSupport::ExecutionContext)
|
74
|
+
require_relative "middleware/execution_context/context_item_process_middleware"
|
75
|
+
c.item_process_middlewares.push("Sbmt::Outbox::Middleware::ExecutionContext::ContextItemProcessMiddleware")
|
76
|
+
end
|
72
77
|
end
|
73
78
|
|
74
79
|
rake_tasks do
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "sbmt/outbox/middleware/execution_context/context_item_process_middleware"
|
4
|
+
|
5
|
+
module Sbmt
|
6
|
+
module Outbox
|
7
|
+
module Middleware
|
8
|
+
module ExecutionContext
|
9
|
+
class ContextItemProcessMiddleware
|
10
|
+
def call(item)
|
11
|
+
ActiveSupport::ExecutionContext[:box_item] = item
|
12
|
+
|
13
|
+
yield
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/sbmt/outbox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sbmt-outbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sbermarket Ruby-Platform Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|
@@ -544,6 +544,7 @@ files:
|
|
544
544
|
- app/models/sbmt/outbox/outbox_item.rb
|
545
545
|
- app/models/sbmt/outbox/outbox_item_config.rb
|
546
546
|
- app/views/sbmt/outbox/root/index.erb
|
547
|
+
- config/initializers/active_record.rb
|
547
548
|
- config/initializers/schked.rb
|
548
549
|
- config/initializers/yabeda.rb
|
549
550
|
- config/routes.rb
|
@@ -582,6 +583,7 @@ files:
|
|
582
583
|
- lib/sbmt/outbox/logger.rb
|
583
584
|
- lib/sbmt/outbox/metrics/utils.rb
|
584
585
|
- lib/sbmt/outbox/middleware/builder.rb
|
586
|
+
- lib/sbmt/outbox/middleware/execution_context/context_item_process_middleware.rb
|
585
587
|
- lib/sbmt/outbox/middleware/open_telemetry/tracing_create_batch_middleware.rb
|
586
588
|
- lib/sbmt/outbox/middleware/open_telemetry/tracing_create_item_middleware.rb
|
587
589
|
- lib/sbmt/outbox/middleware/open_telemetry/tracing_item_process_middleware.rb
|
@@ -638,7 +640,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
638
640
|
- !ruby/object:Gem::Version
|
639
641
|
version: '0'
|
640
642
|
requirements: []
|
641
|
-
rubygems_version: 3.
|
643
|
+
rubygems_version: 3.1.6
|
642
644
|
signing_key:
|
643
645
|
specification_version: 4
|
644
646
|
summary: Outbox service
|