sbmt-outbox 6.0.1 → 6.1.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 +8 -5
- data/config/initializers/yabeda.rb +1 -1
- data/lib/sbmt/outbox/v1/worker.rb +2 -1
- data/lib/sbmt/outbox/v2/tasks/base.rb +3 -0
- data/lib/sbmt/outbox/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79fa90bd3bacbdd8a68708d1f738ca229bd055a074a25f6ac24b2178cb83561f
|
4
|
+
data.tar.gz: 969d866c25c526095dd9719eeb7b8c9604e944ad2c4064f329705fdff654b51b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2f9840f8d2d0a421a2869681acc46cb1d333dab947ae327c55cb31cd41e1fcfa9aeff4b692374521416549f78105fcf72b696ff1f36ace765b1cb073a1e3ef2
|
7
|
+
data.tar.gz: 2ed0fbd2cb506e6d946bb7973cec701dece56dfd8b951cd064714a747c742098bf4bb2a798bc77b9f2acd4131e91cb19d6871263853194dec2fa64bd2040ea64
|
data/README.md
CHANGED
@@ -146,7 +146,6 @@ default: &default
|
|
146
146
|
my_outbox_item: # underscored model class name
|
147
147
|
owner: my_outbox_item_team # optional, used in Yabeda metrics
|
148
148
|
retention: P1W # retention period, https://en.wikipedia.org/wiki/ISO_8601#Durations
|
149
|
-
partition_size: 2 # default 1, partitions count
|
150
149
|
max_retries: 3 # default 0, the number of retries before the item will be marked as failed
|
151
150
|
transports: # transports section
|
152
151
|
produce_message: # underscored transport class name
|
@@ -287,7 +286,6 @@ inbox_items: # inbox items section
|
|
287
286
|
my_inbox_item: # underscored model class name
|
288
287
|
owner: my_inbox_item_team # optional, used in Yabeda metrics
|
289
288
|
retention: P1W # retention period, https://en.wikipedia.org/wiki/ISO_8601#Durations
|
290
|
-
partition_size: 2 # default 1, partitions count
|
291
289
|
max_retries: 3 # default 0, the number of retries before the item will be marked as failed
|
292
290
|
transports: # transports section
|
293
291
|
import_order: # underscored transport class name
|
@@ -376,9 +374,14 @@ outbox_items:
|
|
376
374
|
|
377
375
|
## Concurrency
|
378
376
|
|
379
|
-
The
|
380
|
-
|
381
|
-
|
377
|
+
The worker process consists of a poller and a processor, each of which has its own thread pool.
|
378
|
+
The poller is responsible for fetching messages ready for processing from the database table.
|
379
|
+
The processor, in turn, is used for their consistent processing (while preserving the order of messages and the partitioning key).
|
380
|
+
Each bunch of buckets (i.e. buckets partition) is consistently fetched by poller one at a time. Each bucket is processed one at a time by a processor.
|
381
|
+
A bucket is a number in a row in the `bucket` column generated by the partitioning strategy based on the `event_key` column when a message was committed to the database within the range of zero to `bucket_size`.
|
382
|
+
The number of bucket partitions, which poller uses is 6 by default. The number of poller threads is 2 by default and is not intended for customization.
|
383
|
+
The default number of processor threads is 4 and can be configured with the --concurrency option, thereby allowing you to customize message processing performance.
|
384
|
+
This architecture was designed to allow the daemons to scale without stopping the entire system in order to avoid mixing messages chronologically.
|
382
385
|
|
383
386
|
### Middlewares
|
384
387
|
|
@@ -127,7 +127,8 @@ module Sbmt
|
|
127
127
|
yabeda_labels: {
|
128
128
|
type: item_class.box_type,
|
129
129
|
name: item_class.box_name,
|
130
|
-
partition: partition
|
130
|
+
partition: partition,
|
131
|
+
owner: item_class.owner
|
131
132
|
},
|
132
133
|
resource_key: resource_key,
|
133
134
|
resource_path: "sbmt/outbox/worker/#{resource_key}"
|
@@ -7,6 +7,8 @@ module Sbmt
|
|
7
7
|
class Base
|
8
8
|
attr_reader :item_class, :worker_name, :worker_version, :log_tags, :yabeda_labels
|
9
9
|
|
10
|
+
delegate :owner, to: :item_class
|
11
|
+
|
10
12
|
def initialize(item_class:, worker_name:, worker_version: 2)
|
11
13
|
@item_class = item_class
|
12
14
|
@worker_name = worker_name
|
@@ -22,6 +24,7 @@ module Sbmt
|
|
22
24
|
@yabeda_labels = {
|
23
25
|
type: item_class.box_type,
|
24
26
|
name: metric_safe(item_class.box_name),
|
27
|
+
owner: owner,
|
25
28
|
worker_version: 2,
|
26
29
|
worker_name: worker_name
|
27
30
|
}
|
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.0
|
4
|
+
version: 6.1.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-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|