jetstream_bridge 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d4dcab294bcdbc3c618eef156debf4d7d5e567a105c7795b509cc68543cb592
|
4
|
+
data.tar.gz: de590eb069ca8f09a17b69c53cdc01c4730563ce51f9f43f937cff66d41df700
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09c98872c6174c4c5a71d1d94d049ce0e554a0667e9a0db864a0a245a6d1cb5865db9b9a979de3d39a2948a7943da260e8f2c9d90fcd74f3eee65490e2d63968'
|
7
|
+
data.tar.gz: 4405598ee5e9050c1f344ed00e388974da0959775a9cd07460ec2f6dbf5c730f562210c2c35e16e5b0b2e3eac61bc3905e294dd3066c61f7bce12a4108000ff7
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -100,8 +100,8 @@ end
|
|
100
100
|
|
101
101
|
| Direction | Subject Pattern |
|
102
102
|
|---------------|---------------------------|
|
103
|
-
| **Publish** | `{env}.
|
104
|
-
| **Subscribe** | `{env}.
|
103
|
+
| **Publish** | `{env}.{app}.sync.{dest}` |
|
104
|
+
| **Subscribe** | `{env}.{dest}.sync.{app}` |
|
105
105
|
| **DLQ** | `{env}.sync.dlq` |
|
106
106
|
|
107
107
|
* `{app}`: `app_name`
|
@@ -114,8 +114,8 @@ end
|
|
114
114
|
|
115
115
|
On first connection, Jetstream Bridge **ensures** a single stream exists for your `env` and that it covers:
|
116
116
|
|
117
|
-
* `source_subject` (`{env}.
|
118
|
-
* `destination_subject` (`{env}.
|
117
|
+
* `source_subject` (`{env}.{app}.sync.{dest}`)
|
118
|
+
* `destination_subject` (`{env}.{dest}.sync.{app}`)
|
119
119
|
* `dlq_subject` (if enabled)
|
120
120
|
|
121
121
|
It’s **overlap-safe**:
|
@@ -13,7 +13,7 @@ require_relative 'subscription_manager'
|
|
13
13
|
require_relative 'inbox/inbox_processor'
|
14
14
|
|
15
15
|
module JetstreamBridge
|
16
|
-
# Subscribes to "{env}.
|
16
|
+
# Subscribes to "{env}.{dest}.sync.{app}" and processes messages.
|
17
17
|
class Consumer
|
18
18
|
DEFAULT_BATCH_SIZE = 25
|
19
19
|
FETCH_TIMEOUT_SECS = 5
|
@@ -30,8 +30,8 @@ module JetstreamBridge
|
|
30
30
|
end
|
31
31
|
|
32
32
|
# Base subjects
|
33
|
-
# Producer publishes to: {env}.
|
34
|
-
# Consumer subscribes to: {env}.
|
33
|
+
# Producer publishes to: {env}.{app}.sync.{dest}
|
34
|
+
# Consumer subscribes to: {env}.{dest}.sync.{app}
|
35
35
|
def source_subject
|
36
36
|
"#{env}.#{app_name}.sync.#{destination_app}"
|
37
37
|
end
|
@@ -9,7 +9,7 @@ require_relative '../core/model_utils'
|
|
9
9
|
require_relative 'outbox_repository'
|
10
10
|
|
11
11
|
module JetstreamBridge
|
12
|
-
# Publishes to "{env}.
|
12
|
+
# Publishes to "{env}.{app}.sync.{dest}".
|
13
13
|
class Publisher
|
14
14
|
DEFAULT_RETRIES = 2
|
15
15
|
RETRY_BACKOFFS = [0.25, 1.0].freeze
|
@@ -77,7 +77,7 @@ module JetstreamBridge
|
|
77
77
|
|
78
78
|
repo.persist_pre(record, subject, envelope)
|
79
79
|
|
80
|
-
ok = with_retries { do_publish(subject, envelope) }
|
80
|
+
ok = with_retries { do_publish?(subject, envelope) }
|
81
81
|
ok ? repo.persist_success(record) : repo.persist_failure(record, 'Publish returned false')
|
82
82
|
ok
|
83
83
|
rescue StandardError => e
|