pub_sub_model_sync 0.5.9 → 1.0.beta1

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: cb036497d0e5f977a99a7a4b18b766ae910ed8f72775deac8b5e4d862277085b
4
- data.tar.gz: 3eac2629bf814e169199bd95fece47eaf032d10a7a2e311a81e46d50255947b2
3
+ metadata.gz: 13b5f627ef31865359d033508451bca2297f99cf2cba31d2d3b1a0edb5e0120e
4
+ data.tar.gz: e273ff16f01bda1cae1ec2d78b8fd33174dadccdc78b4430503bd5ae40a35988
5
5
  SHA512:
6
- metadata.gz: 1e34579693469d286ed7fdb6346ac4e4bdf3c000f98d96a4a4b143a0c9c71b3d5df7c441e9069bea4661f5ac7ea8bf2db41f5ad8c55e41a66585602a4bb3d275
7
- data.tar.gz: f13e18fe535720ca299dcd65f76a24c3aae44df0dd3e2515adf5c3095f21d19ad5f16246447d7b15f4c03867495c36b18869cde78e6fbaec573493d340890db6
6
+ metadata.gz: 8bbff15963073476121be61b70abc9899b34c88f12d4b0c75e658f9554cb97b7a6adfeeff7eb1b265fcdd46d3ab2a9bfe97274fc9cd2d67b3a7192d28cf52fb8
7
+ data.tar.gz: dea3272e6930728975dfa140e5b49355ce799c9361d892f0d2acd5a665a699f16383a930db714f64746f03185726abaa1a477da1ae03a3ca22730e750397dccc
@@ -24,7 +24,7 @@ jobs:
24
24
  steps:
25
25
  - uses: actions/checkout@v2
26
26
  - name: Set up Ruby
27
- uses: actions/setup-ruby@v1
27
+ uses: ruby/setup-ruby@v1
28
28
  with:
29
29
  ruby-version: ${{ matrix.ruby }}
30
30
  - name: Install sqlite3
data/.rubocop.yml CHANGED
@@ -7,6 +7,7 @@ AllCops:
7
7
  - 'Gemfile'
8
8
  - 'Rakefile'
9
9
  - 'bin/*'
10
+ - 'samples/**/*'
10
11
 
11
12
  Metrics/BlockLength:
12
13
  Exclude:
data/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # Change Log
2
2
 
3
+ # 1.0.beta (May 13, 2021)
4
+ - Refactor: Subscribers param renamed `from_action` into `to_action` and added support for block or lambda
5
+ - Feat: Improved `ps_subscribe` to accept new arguments and support for property mappings
6
+ - Refactor: Refactored `ps_publish` to be called manually (removes notification assumptions) and accept for new arguments
7
+ - Feat: Added `ps_on_crud_event` to listen CRUD events to send notifications in the expected order
8
+ - Feat: Added `config.default_topic_name` to define default topic name whe publishing (by default `config.topic_name`)
9
+ - Refactor: Refactored PubSub Transactions to support rollbacks (any exception inside transactions can automatically cancel all pending notifications: configurable through `config.transactions_use_buffer`)
10
+ - Feat: Improved CRUD transactions to deliver inner notifications in the expected order to keep data consistency
11
+ - System refactor: Added subscriber runner
12
+ - Fix: Class notifications can only be listened by class subscriptions
13
+ - Refactor: Removed `publish_model_data` to have a unique model publisher `ps_publish`
14
+ - Refactor: Renamed `ps_before_sync` into `ps_before_publish`, `ps_skip_sync` into `ps_skip_publish`, `ps_after_sync` into `ps_after_publish`
15
+ - Refactor: Renamed `payload.attributes` into `payload.info`
16
+ - Feat: Support for plain Ruby Objects (Non ActiveRecord models)
17
+ - Fix: Retry errors for 5 times before exiting notifications listener
18
+
19
+ # 0.6.0 (March 03, 2021)
20
+ - feat: add support to include custom payload headers
21
+ - feat: add pubsub transactions to process all payloads inside in the same order they were published
22
+ - feat: when a model is created/updated/destroyed, process all related payloads in a single transaction
23
+ - feat: add method to save processed payload (:ps_processing_payload) when saving sync
24
+ - feat: add "ordering_key" support to process all payloads with the same key in the same order
25
+ - feat: start multiple workers to process async kafka messages when starting service listeners
26
+ - feat: make async publisher by reusing exchange connection (rabbit)
27
+ - feat: add support for forced_ordering_key to always be used as the ordering_key if defined
28
+ - feat: add feature to publish a message to a custom and/or multiple topics
29
+ - feat: add model custom action subscriber and publisher
30
+ - feat: add docker compose settings
31
+
32
+ # 0.5.10 (February 13, 2021)
33
+ - feat: remove duplicated callback :ps_before_save_sync (same result can be achieved with :ps_before_save_sync)
34
+ - feat: improve message starter to retry when failed or exit system when persists
35
+ - feat: fix and retry when database connection error (PG::UnableToSend)
36
+ - feat: add method to save processed payload (:ps_processing_payload) when saving sync
37
+ - chore: improved readme (Thanks @CharlieIGG)
38
+
39
+ # 0.5.9.1 (February 10, 2021)
40
+ - feat: move :key into headers
41
+
3
42
  # 0.5.9 (February 10, 2021)
4
43
  - feat: reformat :publish and :process methods to include non silence methods
5
44
  - feat: add notification key to payloads (can be used for caching strategies)
data/Dockerfile ADDED
@@ -0,0 +1,6 @@
1
+ FROM ruby:2.5
2
+ RUN apt-get update -qq
3
+ WORKDIR /app
4
+ COPY . /app
5
+ RUN gem update bundler
6
+ RUN bundle update
data/Gemfile.lock CHANGED
@@ -1,201 +1,215 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pub_sub_model_sync (0.5.9)
4
+ pub_sub_model_sync (1.0.beta1)
5
5
  rails
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (6.0.2.2)
11
- actionpack (= 6.0.2.2)
10
+ actioncable (6.1.3.2)
11
+ actionpack (= 6.1.3.2)
12
+ activesupport (= 6.1.3.2)
12
13
  nio4r (~> 2.0)
13
14
  websocket-driver (>= 0.6.1)
14
- actionmailbox (6.0.2.2)
15
- actionpack (= 6.0.2.2)
16
- activejob (= 6.0.2.2)
17
- activerecord (= 6.0.2.2)
18
- activestorage (= 6.0.2.2)
19
- activesupport (= 6.0.2.2)
15
+ actionmailbox (6.1.3.2)
16
+ actionpack (= 6.1.3.2)
17
+ activejob (= 6.1.3.2)
18
+ activerecord (= 6.1.3.2)
19
+ activestorage (= 6.1.3.2)
20
+ activesupport (= 6.1.3.2)
20
21
  mail (>= 2.7.1)
21
- actionmailer (6.0.2.2)
22
- actionpack (= 6.0.2.2)
23
- actionview (= 6.0.2.2)
24
- activejob (= 6.0.2.2)
22
+ actionmailer (6.1.3.2)
23
+ actionpack (= 6.1.3.2)
24
+ actionview (= 6.1.3.2)
25
+ activejob (= 6.1.3.2)
26
+ activesupport (= 6.1.3.2)
25
27
  mail (~> 2.5, >= 2.5.4)
26
28
  rails-dom-testing (~> 2.0)
27
- actionpack (6.0.2.2)
28
- actionview (= 6.0.2.2)
29
- activesupport (= 6.0.2.2)
30
- rack (~> 2.0, >= 2.0.8)
29
+ actionpack (6.1.3.2)
30
+ actionview (= 6.1.3.2)
31
+ activesupport (= 6.1.3.2)
32
+ rack (~> 2.0, >= 2.0.9)
31
33
  rack-test (>= 0.6.3)
32
34
  rails-dom-testing (~> 2.0)
33
35
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
34
- actiontext (6.0.2.2)
35
- actionpack (= 6.0.2.2)
36
- activerecord (= 6.0.2.2)
37
- activestorage (= 6.0.2.2)
38
- activesupport (= 6.0.2.2)
36
+ actiontext (6.1.3.2)
37
+ actionpack (= 6.1.3.2)
38
+ activerecord (= 6.1.3.2)
39
+ activestorage (= 6.1.3.2)
40
+ activesupport (= 6.1.3.2)
39
41
  nokogiri (>= 1.8.5)
40
- actionview (6.0.2.2)
41
- activesupport (= 6.0.2.2)
42
+ actionview (6.1.3.2)
43
+ activesupport (= 6.1.3.2)
42
44
  builder (~> 3.1)
43
45
  erubi (~> 1.4)
44
46
  rails-dom-testing (~> 2.0)
45
47
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
46
- activejob (6.0.2.2)
47
- activesupport (= 6.0.2.2)
48
+ activejob (6.1.3.2)
49
+ activesupport (= 6.1.3.2)
48
50
  globalid (>= 0.3.6)
49
- activemodel (6.0.2.2)
50
- activesupport (= 6.0.2.2)
51
- activerecord (6.0.2.2)
52
- activemodel (= 6.0.2.2)
53
- activesupport (= 6.0.2.2)
54
- activestorage (6.0.2.2)
55
- actionpack (= 6.0.2.2)
56
- activejob (= 6.0.2.2)
57
- activerecord (= 6.0.2.2)
58
- marcel (~> 0.3.1)
59
- activesupport (6.0.2.2)
51
+ activemodel (6.1.3.2)
52
+ activesupport (= 6.1.3.2)
53
+ activerecord (6.1.3.2)
54
+ activemodel (= 6.1.3.2)
55
+ activesupport (= 6.1.3.2)
56
+ activestorage (6.1.3.2)
57
+ actionpack (= 6.1.3.2)
58
+ activejob (= 6.1.3.2)
59
+ activerecord (= 6.1.3.2)
60
+ activesupport (= 6.1.3.2)
61
+ marcel (~> 1.0.0)
62
+ mini_mime (~> 1.0.2)
63
+ activesupport (6.1.3.2)
60
64
  concurrent-ruby (~> 1.0, >= 1.0.2)
61
- i18n (>= 0.7, < 2)
62
- minitest (~> 5.1)
63
- tzinfo (~> 1.1)
64
- zeitwerk (~> 2.2)
65
+ i18n (>= 1.6, < 2)
66
+ minitest (>= 5.1)
67
+ tzinfo (~> 2.0)
68
+ zeitwerk (~> 2.3)
65
69
  addressable (2.7.0)
66
70
  public_suffix (>= 2.0.2, < 5.0)
67
- amq-protocol (2.3.0)
68
- ast (2.4.1)
71
+ amq-protocol (2.3.2)
72
+ ast (2.4.2)
69
73
  builder (3.2.4)
70
- bunny (2.14.3)
71
- amq-protocol (~> 2.3, >= 2.3.0)
72
- concurrent-ruby (1.1.6)
74
+ bunny (2.17.0)
75
+ amq-protocol (~> 2.3, >= 2.3.1)
76
+ concurrent-ruby (1.1.8)
73
77
  crass (1.0.6)
74
- database_cleaner (1.8.4)
75
- database_cleaner-active_record (1.8.0)
76
- activerecord
77
- database_cleaner (~> 1.8.0)
78
- diff-lcs (1.3)
79
- digest-crc (0.5.1)
78
+ database_cleaner-active_record (2.0.1)
79
+ activerecord (>= 5.a)
80
+ database_cleaner-core (~> 2.0.0)
81
+ database_cleaner-core (2.0.1)
82
+ diff-lcs (1.4.4)
83
+ digest-crc (0.6.3)
84
+ rake (>= 12.0.0, < 14.0.0)
80
85
  erubi (1.10.0)
81
- faraday (1.1.0)
86
+ faraday (1.4.1)
87
+ faraday-excon (~> 1.1)
88
+ faraday-net_http (~> 1.0)
89
+ faraday-net_http_persistent (~> 1.1)
82
90
  multipart-post (>= 1.2, < 3)
83
- ruby2_keywords
84
- gapic-common (0.3.4)
85
- google-protobuf (~> 3.12, >= 3.12.2)
86
- googleapis-common-protos (>= 1.3.9, < 2.0)
87
- googleapis-common-protos-types (>= 1.0.4, < 2.0)
88
- googleauth (~> 0.9)
89
- grpc (~> 1.25)
91
+ ruby2_keywords (>= 0.0.4)
92
+ faraday-excon (1.1.0)
93
+ faraday-net_http (1.0.1)
94
+ faraday-net_http_persistent (1.1.0)
95
+ gapic-common (0.4.1)
96
+ faraday (~> 1.3)
97
+ google-protobuf (~> 3.15, >= 3.15.2)
98
+ googleapis-common-protos (>= 1.3.11, < 2.0)
99
+ googleapis-common-protos-types (>= 1.0.6, < 2.0)
100
+ googleauth (~> 0.15, >= 0.15.1)
101
+ grpc (~> 1.36)
90
102
  globalid (0.4.2)
91
103
  activesupport (>= 4.2.0)
92
- google-cloud-core (1.5.0)
104
+ google-cloud-core (1.6.0)
93
105
  google-cloud-env (~> 1.0)
94
106
  google-cloud-errors (~> 1.0)
95
- google-cloud-env (1.4.0)
107
+ google-cloud-env (1.5.0)
96
108
  faraday (>= 0.17.3, < 2.0)
97
- google-cloud-errors (1.0.1)
98
- google-cloud-pubsub (2.3.0)
109
+ google-cloud-errors (1.1.0)
110
+ google-cloud-pubsub (2.6.1)
99
111
  concurrent-ruby (~> 1.1)
100
112
  google-cloud-core (~> 1.5)
101
113
  google-cloud-pubsub-v1 (~> 0.0)
102
- google-cloud-pubsub-v1 (0.1.2)
114
+ google-cloud-pubsub-v1 (0.4.0)
103
115
  gapic-common (~> 0.3)
104
116
  google-cloud-errors (~> 1.0)
105
117
  grpc-google-iam-v1 (>= 0.6.10, < 2.0)
106
- google-protobuf (3.14.0-universal-darwin)
107
- googleapis-common-protos (1.3.10)
108
- google-protobuf (~> 3.11)
109
- googleapis-common-protos-types (>= 1.0.5, < 2.0)
118
+ google-protobuf (3.17.0)
119
+ google-protobuf (3.17.0-x86_64-linux)
120
+ googleapis-common-protos (1.3.11)
121
+ google-protobuf (~> 3.14)
122
+ googleapis-common-protos-types (>= 1.0.6, < 2.0)
110
123
  grpc (~> 1.27)
111
- googleapis-common-protos-types (1.0.5)
112
- google-protobuf (~> 3.11)
113
- googleauth (0.14.0)
124
+ googleapis-common-protos-types (1.0.6)
125
+ google-protobuf (~> 3.14)
126
+ googleauth (0.16.2)
114
127
  faraday (>= 0.17.3, < 2.0)
115
128
  jwt (>= 1.4, < 3.0)
116
129
  memoist (~> 0.16)
117
130
  multi_json (~> 1.11)
118
131
  os (>= 0.9, < 2.0)
119
132
  signet (~> 0.14)
120
- grpc (1.34.0-universal-darwin)
121
- google-protobuf (~> 3.13)
133
+ grpc (1.37.1)
134
+ google-protobuf (~> 3.15)
122
135
  googleapis-common-protos-types (~> 1.0)
123
- grpc-google-iam-v1 (0.6.10)
124
- google-protobuf (~> 3.11)
125
- googleapis-common-protos (>= 1.3.10, < 2.0)
136
+ grpc (1.37.1-x86_64-linux)
137
+ google-protobuf (~> 3.15)
138
+ googleapis-common-protos-types (~> 1.0)
139
+ grpc-google-iam-v1 (0.6.11)
140
+ google-protobuf (~> 3.14)
141
+ googleapis-common-protos (>= 1.3.11, < 2.0)
126
142
  grpc (~> 1.27)
127
- i18n (1.8.2)
143
+ i18n (1.8.10)
128
144
  concurrent-ruby (~> 1.0)
129
- jwt (2.2.2)
130
- loofah (2.8.0)
145
+ jwt (2.2.3)
146
+ loofah (2.9.1)
131
147
  crass (~> 1.0.2)
132
148
  nokogiri (>= 1.5.9)
133
149
  mail (2.7.1)
134
150
  mini_mime (>= 0.1.1)
135
- marcel (0.3.3)
136
- mimemagic (~> 0.3.2)
151
+ marcel (1.0.1)
137
152
  memoist (0.16.2)
138
153
  method_source (1.0.0)
139
- mimemagic (0.3.5)
140
- mini_mime (1.0.2)
141
- mini_portile2 (2.4.0)
142
- minitest (5.14.0)
154
+ mini_mime (1.0.3)
155
+ minitest (5.14.4)
143
156
  multi_json (1.15.0)
144
157
  multipart-post (2.1.1)
145
- nio4r (2.5.4)
146
- nokogiri (1.10.10)
147
- mini_portile2 (~> 2.4.0)
158
+ nio4r (2.5.7)
159
+ nokogiri (1.11.3-x86_64-darwin)
160
+ racc (~> 1.4)
148
161
  os (1.1.1)
149
162
  parallel (1.20.1)
150
- parser (2.7.2.0)
163
+ parser (3.0.1.1)
151
164
  ast (~> 2.4.1)
152
165
  public_suffix (4.0.6)
166
+ racc (1.5.2)
153
167
  rack (2.2.3)
154
168
  rack-test (1.1.0)
155
169
  rack (>= 1.0, < 3)
156
- rails (6.0.2.2)
157
- actioncable (= 6.0.2.2)
158
- actionmailbox (= 6.0.2.2)
159
- actionmailer (= 6.0.2.2)
160
- actionpack (= 6.0.2.2)
161
- actiontext (= 6.0.2.2)
162
- actionview (= 6.0.2.2)
163
- activejob (= 6.0.2.2)
164
- activemodel (= 6.0.2.2)
165
- activerecord (= 6.0.2.2)
166
- activestorage (= 6.0.2.2)
167
- activesupport (= 6.0.2.2)
168
- bundler (>= 1.3.0)
169
- railties (= 6.0.2.2)
170
+ rails (6.1.3.2)
171
+ actioncable (= 6.1.3.2)
172
+ actionmailbox (= 6.1.3.2)
173
+ actionmailer (= 6.1.3.2)
174
+ actionpack (= 6.1.3.2)
175
+ actiontext (= 6.1.3.2)
176
+ actionview (= 6.1.3.2)
177
+ activejob (= 6.1.3.2)
178
+ activemodel (= 6.1.3.2)
179
+ activerecord (= 6.1.3.2)
180
+ activestorage (= 6.1.3.2)
181
+ activesupport (= 6.1.3.2)
182
+ bundler (>= 1.15.0)
183
+ railties (= 6.1.3.2)
170
184
  sprockets-rails (>= 2.0.0)
171
185
  rails-dom-testing (2.0.3)
172
186
  activesupport (>= 4.2.0)
173
187
  nokogiri (>= 1.6)
174
188
  rails-html-sanitizer (1.3.0)
175
189
  loofah (~> 2.3)
176
- railties (6.0.2.2)
177
- actionpack (= 6.0.2.2)
178
- activesupport (= 6.0.2.2)
190
+ railties (6.1.3.2)
191
+ actionpack (= 6.1.3.2)
192
+ activesupport (= 6.1.3.2)
179
193
  method_source
180
194
  rake (>= 0.8.7)
181
- thor (>= 0.20.3, < 2.0)
195
+ thor (~> 1.0)
182
196
  rainbow (3.0.0)
183
- rake (13.0.1)
184
- regexp_parser (2.0.1)
185
- rexml (3.2.4)
186
- rspec (3.9.0)
187
- rspec-core (~> 3.9.0)
188
- rspec-expectations (~> 3.9.0)
189
- rspec-mocks (~> 3.9.0)
190
- rspec-core (3.9.1)
191
- rspec-support (~> 3.9.1)
192
- rspec-expectations (3.9.0)
197
+ rake (13.0.3)
198
+ regexp_parser (2.1.1)
199
+ rexml (3.2.5)
200
+ rspec (3.10.0)
201
+ rspec-core (~> 3.10.0)
202
+ rspec-expectations (~> 3.10.0)
203
+ rspec-mocks (~> 3.10.0)
204
+ rspec-core (3.10.1)
205
+ rspec-support (~> 3.10.0)
206
+ rspec-expectations (3.10.1)
193
207
  diff-lcs (>= 1.2.0, < 2.0)
194
- rspec-support (~> 3.9.0)
195
- rspec-mocks (3.9.1)
208
+ rspec-support (~> 3.10.0)
209
+ rspec-mocks (3.10.2)
196
210
  diff-lcs (>= 1.2.0, < 2.0)
197
- rspec-support (~> 3.9.0)
198
- rspec-support (3.9.2)
211
+ rspec-support (~> 3.10.0)
212
+ rspec-support (3.10.2)
199
213
  rubocop (1.6.1)
200
214
  parallel (~> 1.10)
201
215
  parser (>= 2.7.1.5)
@@ -205,13 +219,13 @@ GEM
205
219
  rubocop-ast (>= 1.2.0, < 2.0)
206
220
  ruby-progressbar (~> 1.7)
207
221
  unicode-display_width (>= 1.4.0, < 2.0)
208
- rubocop-ast (1.3.0)
209
- parser (>= 2.7.1.5)
210
- ruby-kafka (1.0.0)
222
+ rubocop-ast (1.5.0)
223
+ parser (>= 3.0.1.1)
224
+ ruby-kafka (1.3.0)
211
225
  digest-crc
212
- ruby-progressbar (1.10.1)
213
- ruby2_keywords (0.0.2)
214
- signet (0.14.0)
226
+ ruby-progressbar (1.11.0)
227
+ ruby2_keywords (0.0.4)
228
+ signet (0.15.0)
215
229
  addressable (~> 2.3)
216
230
  faraday (>= 0.17.3, < 2.0)
217
231
  jwt (>= 1.5, < 3.0)
@@ -224,18 +238,18 @@ GEM
224
238
  activesupport (>= 4.0)
225
239
  sprockets (>= 3.0.0)
226
240
  sqlite3 (1.4.2)
227
- thor (1.0.1)
228
- thread_safe (0.3.6)
229
- tzinfo (1.2.7)
230
- thread_safe (~> 0.1)
241
+ thor (1.1.0)
242
+ tzinfo (2.0.4)
243
+ concurrent-ruby (~> 1.0)
231
244
  unicode-display_width (1.7.0)
232
245
  websocket-driver (0.7.3)
233
246
  websocket-extensions (>= 0.1.0)
234
247
  websocket-extensions (0.1.5)
235
- zeitwerk (2.3.0)
248
+ zeitwerk (2.4.2)
236
249
 
237
250
  PLATFORMS
238
251
  ruby
252
+ x86_64-linux
239
253
 
240
254
  DEPENDENCIES
241
255
  bundler
@@ -250,4 +264,4 @@ DEPENDENCIES
250
264
  sqlite3
251
265
 
252
266
  BUNDLED WITH
253
- 2.1.4
267
+ 2.2.17