pub_sub_model_sync 1.6.2 → 1.6.4
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/pub_sub_model_sync/message_publisher.rb +3 -1
- data/lib/pub_sub_model_sync/payload.rb +3 -0
- data/lib/pub_sub_model_sync/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: 79bf4750adcd186e0c14bd8c092012a6a9455dd6affcabf603e72e9a011f9bb1
|
4
|
+
data.tar.gz: 9d8efba465a451c7ffe3bd04400cd3efa2e6dfee31fa45885035da744ce88104
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5ab4a0ffdc1b4e2eea91f6889211b04150f0a1857e4d0bc50ab6f1a9894811c0afedb22f3bbce84ee14bf668d24801e98cf512ef657b56a2c2bb4333deb78e7
|
7
|
+
data.tar.gz: 28bf0020235c4b7e6a6b8d54758daa0e72d2a61a55014bfa0646f028cac8227fed6c68df2f4a46effa447854910c2010258280c325f4aa8ea17bfe6cd2d50072
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -318,7 +318,7 @@ Any notification before delivering is transformed as a Payload for a better port
|
|
318
318
|
- `ordering_key`: (String, optional): notifications with the same `ordering_key` are processed in the same order they were delivered, default: `<model.class.name>/<model.id>` when instance notification and `klass_name` when class notification.
|
319
319
|
Note: Final `ordering_key` is calculated as: `payload.headers[:forced_ordering_key] || current_transaction&.key || payload.headers[:ordering_key]`
|
320
320
|
- `topic_name`: (String|Array<String>, optional): Specific topic name where to deliver the notification (default `PubSubModelSync::Config.topic_name`).
|
321
|
-
- `forced_ordering_key`: (String, optional): Overrides `ordering_key` with the provided value even withing transactions. Default `nil
|
321
|
+
- `forced_ordering_key`: (String, optional): Overrides `ordering_key` with the provided value even withing transactions. Default `nil` (if `true`, prevails the payload's `ordering_key`).
|
322
322
|
- `target_app_key`: (String, optional): Allows to send the notification to a specific app (includes the application key, separated by comma when multiple apps). Default `nil`.
|
323
323
|
- `cache` (Boolean | Hash, Default false) Cache settings
|
324
324
|
- `true`: Skip publishing similar payloads
|
@@ -110,7 +110,9 @@ module PubSubModelSync
|
|
110
110
|
end
|
111
111
|
|
112
112
|
def add_transaction_headers(payload)
|
113
|
-
|
113
|
+
force_key = payload.headers[:forced_ordering_key]
|
114
|
+
key = force_key || current_transaction&.key || payload.headers[:ordering_key]
|
115
|
+
key = payload.headers[:ordering_key] if force_key == true
|
114
116
|
payload.headers[:ordering_key] = key
|
115
117
|
payload.headers.merge!(current_transaction.headers) if current_transaction
|
116
118
|
end
|
@@ -85,7 +85,10 @@ module PubSubModelSync
|
|
85
85
|
|
86
86
|
# @param attr_keys (Array<Symbol>) List of attributes to be excluded from payload
|
87
87
|
def exclude_data_attrs(attr_keys)
|
88
|
+
orig_data = data.clone
|
89
|
+
headers[:excluded_attr_keys] = attr_keys.join(',')
|
88
90
|
@data = data.except(*attr_keys)
|
91
|
+
Config.log("Empty payload after payload optimization (original data: #{[self, orig_data]})") if @data == []
|
89
92
|
end
|
90
93
|
|
91
94
|
# Attributes to always be delivered after cache optimization
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pub_sub_model_sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Owen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
11
|
+
date: 2022-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|