pub_sub_model_sync 0.4.2.1 → 0.4.2.2
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.
Potentially problematic release.
This version of pub_sub_model_sync might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +5 -5
- data/lib/pub_sub_model_sync/mock_rabbit_service.rb +1 -0
- data/lib/pub_sub_model_sync/service_rabbit.rb +11 -2
- 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: fc91f91853b7365a48426a08f8da7a1ba4c3693028f788083b3d0787681fc8ea
|
4
|
+
data.tar.gz: b71ddba12df000efc7bd2c15fb47ff6e91690b0a9058014c5192b2d1c14e833e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77f49b619c59a43626e4d74070daf527477e167ce0ed109191f1a38442ab0cb7393eb9e978f081e126b19d55c8525b07c859293548a6bf2ceccc0b0bd89dbc7b
|
7
|
+
data.tar.gz: dcfa697fffb2a45ded19bc965e99428a51ee58c815207cb7f46d5fff61268e5c18d61298850ff53185abf6fee68eba4dc9a7e3c37ee256e193750dd432db88d1
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
# 0.4.2.2 (November 29, 2020)
|
4
|
+
- feat: rabbitMQ skip receiving messages from the same app
|
5
|
+
- feat: rabbitmq use fanout instead of queue to deliver messages to multiple apps
|
6
|
+
|
3
7
|
# 0.4.2.1 (August 20, 2020)
|
4
8
|
- Improve ```ps_subscriber_changed?``` to run validations and check for changes
|
5
9
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
pub_sub_model_sync (0.4.2.
|
4
|
+
pub_sub_model_sync (0.4.2.2)
|
5
5
|
rails
|
6
6
|
|
7
7
|
GEM
|
@@ -77,7 +77,7 @@ GEM
|
|
77
77
|
database_cleaner (~> 1.8.0)
|
78
78
|
diff-lcs (1.3)
|
79
79
|
digest-crc (0.5.1)
|
80
|
-
erubi (1.
|
80
|
+
erubi (1.10.0)
|
81
81
|
faraday (0.17.3)
|
82
82
|
multipart-post (>= 1.2, < 3)
|
83
83
|
globalid (0.4.2)
|
@@ -122,7 +122,7 @@ GEM
|
|
122
122
|
concurrent-ruby (~> 1.0)
|
123
123
|
jaro_winkler (1.5.4)
|
124
124
|
jwt (2.2.1)
|
125
|
-
loofah (2.
|
125
|
+
loofah (2.8.0)
|
126
126
|
crass (~> 1.0.2)
|
127
127
|
nokogiri (>= 1.5.9)
|
128
128
|
mail (2.7.1)
|
@@ -137,7 +137,7 @@ GEM
|
|
137
137
|
minitest (5.14.0)
|
138
138
|
multi_json (1.14.1)
|
139
139
|
multipart-post (2.1.1)
|
140
|
-
nio4r (2.5.
|
140
|
+
nio4r (2.5.4)
|
141
141
|
nokogiri (1.10.10)
|
142
142
|
mini_portile2 (~> 2.4.0)
|
143
143
|
os (1.0.1)
|
@@ -210,7 +210,7 @@ GEM
|
|
210
210
|
sprockets (4.0.2)
|
211
211
|
concurrent-ruby (~> 1.0)
|
212
212
|
rack (> 1, < 3)
|
213
|
-
sprockets-rails (3.2.
|
213
|
+
sprockets-rails (3.2.2)
|
214
214
|
actionpack (>= 4.0)
|
215
215
|
activesupport (>= 4.0)
|
216
216
|
sprockets (>= 3.0.0)
|
@@ -48,7 +48,11 @@ module PubSubModelSync
|
|
48
48
|
private
|
49
49
|
|
50
50
|
def message_settings
|
51
|
-
{
|
51
|
+
{
|
52
|
+
routing_key: queue.name,
|
53
|
+
type: SERVICE_KEY,
|
54
|
+
app_id: app_id
|
55
|
+
}
|
52
56
|
end
|
53
57
|
|
54
58
|
def subscribe_settings
|
@@ -57,6 +61,7 @@ module PubSubModelSync
|
|
57
61
|
|
58
62
|
def process_message(_delivery_info, meta_info, payload)
|
59
63
|
return unless meta_info[:type] == SERVICE_KEY
|
64
|
+
return if meta_info[:app_id] && meta_info[:app_id] == app_id
|
60
65
|
|
61
66
|
perform_message(payload)
|
62
67
|
rescue => e
|
@@ -64,11 +69,15 @@ module PubSubModelSync
|
|
64
69
|
log("Error processing message: #{error}", :error)
|
65
70
|
end
|
66
71
|
|
72
|
+
def app_id
|
73
|
+
(Rails.application.class.parent_name rescue '') # rubocop:disable Style/RescueModifier
|
74
|
+
end
|
75
|
+
|
67
76
|
def subscribe_to_queue
|
68
77
|
service.start
|
69
78
|
@channel = service.create_channel
|
70
79
|
queue_settings = { durable: true, auto_delete: false }
|
71
|
-
@queue = channel.
|
80
|
+
@queue = channel.fanout(config.queue_name, queue_settings)
|
72
81
|
subscribe_to_topic
|
73
82
|
end
|
74
83
|
|
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: 0.4.2.
|
4
|
+
version: 0.4.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Owen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|