cloudenvoy 0.4.2 → 0.6.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/lint_rubocop.yml +20 -0
  3. data/.github/workflows/{test.yml → test_ruby_2.5_2.6.yml} +8 -13
  4. data/.github/workflows/test_ruby_2.7.yml +36 -0
  5. data/.github/workflows/test_ruby_3.x.yml +35 -0
  6. data/.gitignore +1 -0
  7. data/.rubocop.yml +17 -16
  8. data/Appraisals +24 -4
  9. data/CHANGELOG.md +18 -0
  10. data/README.md +39 -2
  11. data/cloudenvoy.gemspec +2 -6
  12. data/examples/rails/.ruby-version +1 -1
  13. data/examples/rails/Gemfile +4 -1
  14. data/examples/rails/Gemfile.lock +92 -85
  15. data/examples/rails/README.md +5 -1
  16. data/examples/rails/app/subscribers/hello_subscriber.rb +1 -1
  17. data/examples/rails/config/environments/production.rb +1 -1
  18. data/examples/rails/config/puma.rb +3 -3
  19. data/examples/sinatra/Gemfile +4 -1
  20. data/examples/sinatra/Gemfile.lock +40 -28
  21. data/examples/sinatra/README.md +4 -0
  22. data/examples/sinatra/app/subscribers/hello_subscriber.rb +1 -1
  23. data/examples/sinatra/app.rb +4 -4
  24. data/gemfiles/.bundle/config +2 -0
  25. data/gemfiles/rails_5.2.gemfile +1 -0
  26. data/gemfiles/rails_6.0.gemfile +1 -0
  27. data/gemfiles/rails_6.1.gemfile +8 -0
  28. data/gemfiles/rails_7.0.gemfile +8 -0
  29. data/gemfiles/semantic_logger_3.4.gemfile +1 -0
  30. data/gemfiles/semantic_logger_4.6.gemfile +1 -0
  31. data/gemfiles/semantic_logger_4.7.0.gemfile +1 -0
  32. data/gemfiles/semantic_logger_4.7.2.gemfile +1 -0
  33. data/lib/cloudenvoy/backend/google_pub_sub.rb +37 -5
  34. data/lib/cloudenvoy/backend/memory_pub_sub.rb +25 -1
  35. data/lib/cloudenvoy/config.rb +1 -1
  36. data/lib/cloudenvoy/message.rb +2 -2
  37. data/lib/cloudenvoy/pub_sub_client.rb +13 -1
  38. data/lib/cloudenvoy/publisher.rb +39 -5
  39. data/lib/cloudenvoy/publisher_logger.rb +1 -1
  40. data/lib/cloudenvoy/version.rb +1 -1
  41. data/lib/cloudenvoy.rb +13 -0
  42. metadata +15 -57
  43. data/gemfiles/rails_5.2.gemfile.lock +0 -264
  44. data/gemfiles/rails_6.0.gemfile.lock +0 -280
  45. data/gemfiles/semantic_logger_3.4.gemfile.lock +0 -279
  46. data/gemfiles/semantic_logger_4.6.gemfile.lock +0 -279
  47. data/gemfiles/semantic_logger_4.7.0.gemfile.lock +0 -279
  48. data/gemfiles/semantic_logger_4.7.2.gemfile.lock +0 -279
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- cloudenvoy (0.4.1)
4
+ cloudenvoy (0.5.0)
5
5
  activesupport
6
6
  google-cloud-pubsub (~> 2.0)
7
7
  jwt
@@ -10,56 +10,56 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- actioncable (6.0.4.1)
14
- actionpack (= 6.0.4.1)
13
+ actioncable (6.0.4.7)
14
+ actionpack (= 6.0.4.7)
15
15
  nio4r (~> 2.0)
16
16
  websocket-driver (>= 0.6.1)
17
- actionmailbox (6.0.4.1)
18
- actionpack (= 6.0.4.1)
19
- activejob (= 6.0.4.1)
20
- activerecord (= 6.0.4.1)
21
- activestorage (= 6.0.4.1)
22
- activesupport (= 6.0.4.1)
17
+ actionmailbox (6.0.4.7)
18
+ actionpack (= 6.0.4.7)
19
+ activejob (= 6.0.4.7)
20
+ activerecord (= 6.0.4.7)
21
+ activestorage (= 6.0.4.7)
22
+ activesupport (= 6.0.4.7)
23
23
  mail (>= 2.7.1)
24
- actionmailer (6.0.4.1)
25
- actionpack (= 6.0.4.1)
26
- actionview (= 6.0.4.1)
27
- activejob (= 6.0.4.1)
24
+ actionmailer (6.0.4.7)
25
+ actionpack (= 6.0.4.7)
26
+ actionview (= 6.0.4.7)
27
+ activejob (= 6.0.4.7)
28
28
  mail (~> 2.5, >= 2.5.4)
29
29
  rails-dom-testing (~> 2.0)
30
- actionpack (6.0.4.1)
31
- actionview (= 6.0.4.1)
32
- activesupport (= 6.0.4.1)
30
+ actionpack (6.0.4.7)
31
+ actionview (= 6.0.4.7)
32
+ activesupport (= 6.0.4.7)
33
33
  rack (~> 2.0, >= 2.0.8)
34
34
  rack-test (>= 0.6.3)
35
35
  rails-dom-testing (~> 2.0)
36
36
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
37
- actiontext (6.0.4.1)
38
- actionpack (= 6.0.4.1)
39
- activerecord (= 6.0.4.1)
40
- activestorage (= 6.0.4.1)
41
- activesupport (= 6.0.4.1)
37
+ actiontext (6.0.4.7)
38
+ actionpack (= 6.0.4.7)
39
+ activerecord (= 6.0.4.7)
40
+ activestorage (= 6.0.4.7)
41
+ activesupport (= 6.0.4.7)
42
42
  nokogiri (>= 1.8.5)
43
- actionview (6.0.4.1)
44
- activesupport (= 6.0.4.1)
43
+ actionview (6.0.4.7)
44
+ activesupport (= 6.0.4.7)
45
45
  builder (~> 3.1)
46
46
  erubi (~> 1.4)
47
47
  rails-dom-testing (~> 2.0)
48
48
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
49
- activejob (6.0.4.1)
50
- activesupport (= 6.0.4.1)
49
+ activejob (6.0.4.7)
50
+ activesupport (= 6.0.4.7)
51
51
  globalid (>= 0.3.6)
52
- activemodel (6.0.4.1)
53
- activesupport (= 6.0.4.1)
54
- activerecord (6.0.4.1)
55
- activemodel (= 6.0.4.1)
56
- activesupport (= 6.0.4.1)
57
- activestorage (6.0.4.1)
58
- actionpack (= 6.0.4.1)
59
- activejob (= 6.0.4.1)
60
- activerecord (= 6.0.4.1)
52
+ activemodel (6.0.4.7)
53
+ activesupport (= 6.0.4.7)
54
+ activerecord (6.0.4.7)
55
+ activemodel (= 6.0.4.7)
56
+ activesupport (= 6.0.4.7)
57
+ activestorage (6.0.4.7)
58
+ actionpack (= 6.0.4.7)
59
+ activejob (= 6.0.4.7)
60
+ activerecord (= 6.0.4.7)
61
61
  marcel (~> 1.0.0)
62
- activesupport (6.0.4.1)
62
+ activesupport (6.0.4.7)
63
63
  concurrent-ruby (~> 1.0, >= 1.0.2)
64
64
  i18n (>= 0.7, < 2)
65
65
  minitest (~> 5.1)
@@ -71,33 +71,37 @@ GEM
71
71
  concurrent-ruby (1.1.9)
72
72
  crass (1.0.6)
73
73
  erubi (1.10.0)
74
- faraday (1.8.0)
74
+ faraday (1.10.0)
75
75
  faraday-em_http (~> 1.0)
76
76
  faraday-em_synchrony (~> 1.0)
77
77
  faraday-excon (~> 1.1)
78
- faraday-httpclient (~> 1.0.1)
78
+ faraday-httpclient (~> 1.0)
79
+ faraday-multipart (~> 1.0)
79
80
  faraday-net_http (~> 1.0)
80
- faraday-net_http_persistent (~> 1.1)
81
+ faraday-net_http_persistent (~> 1.0)
81
82
  faraday-patron (~> 1.0)
82
83
  faraday-rack (~> 1.0)
83
- multipart-post (>= 1.2, < 3)
84
+ faraday-retry (~> 1.0)
84
85
  ruby2_keywords (>= 0.0.4)
85
86
  faraday-em_http (1.0.0)
86
87
  faraday-em_synchrony (1.0.0)
87
88
  faraday-excon (1.1.0)
88
89
  faraday-httpclient (1.0.1)
90
+ faraday-multipart (1.0.3)
91
+ multipart-post (>= 1.2, < 3)
89
92
  faraday-net_http (1.0.1)
90
93
  faraday-net_http_persistent (1.2.0)
91
94
  faraday-patron (1.0.0)
92
95
  faraday-rack (1.0.0)
93
- gapic-common (0.7.0)
96
+ faraday-retry (1.0.3)
97
+ gapic-common (0.8.0)
94
98
  faraday (~> 1.3)
95
99
  google-protobuf (~> 3.14)
96
100
  googleapis-common-protos (>= 1.3.11, < 2.a)
97
101
  googleapis-common-protos-types (>= 1.0.6, < 2.a)
98
102
  googleauth (>= 0.17.0, < 2.a)
99
103
  grpc (~> 1.36)
100
- globalid (0.5.2)
104
+ globalid (1.0.0)
101
105
  activesupport (>= 5.0)
102
106
  google-cloud-core (1.6.0)
103
107
  google-cloud-env (~> 1.0)
@@ -105,39 +109,39 @@ GEM
105
109
  google-cloud-env (1.5.0)
106
110
  faraday (>= 0.17.3, < 2.0)
107
111
  google-cloud-errors (1.2.0)
108
- google-cloud-pubsub (2.8.1)
112
+ google-cloud-pubsub (2.9.1)
109
113
  concurrent-ruby (~> 1.1)
110
114
  google-cloud-core (~> 1.5)
111
115
  google-cloud-pubsub-v1 (~> 0.0)
112
- google-cloud-pubsub-v1 (0.6.0)
116
+ google-cloud-pubsub-v1 (0.7.1)
113
117
  gapic-common (>= 0.7, < 2.a)
114
118
  google-cloud-errors (~> 1.0)
115
119
  grpc-google-iam-v1 (>= 0.6.10, < 2.a)
116
- google-protobuf (3.18.0)
120
+ google-protobuf (3.19.4)
117
121
  googleapis-common-protos (1.3.12)
118
122
  google-protobuf (~> 3.14)
119
123
  googleapis-common-protos-types (~> 1.2)
120
124
  grpc (~> 1.27)
121
- googleapis-common-protos-types (1.2.0)
125
+ googleapis-common-protos-types (1.3.0)
122
126
  google-protobuf (~> 3.14)
123
- googleauth (1.0.0)
124
- faraday (>= 0.17.3, < 2.0)
127
+ googleauth (1.1.2)
128
+ faraday (>= 0.17.3, < 3.a)
125
129
  jwt (>= 1.4, < 3.0)
126
130
  memoist (~> 0.16)
127
131
  multi_json (~> 1.11)
128
132
  os (>= 0.9, < 2.0)
129
133
  signet (>= 0.16, < 2.a)
130
- grpc (1.40.0)
131
- google-protobuf (~> 3.15)
134
+ grpc (1.43.1)
135
+ google-protobuf (~> 3.18)
132
136
  googleapis-common-protos-types (~> 1.0)
133
137
  grpc-google-iam-v1 (1.0.0)
134
138
  google-protobuf (~> 3.14)
135
139
  googleapis-common-protos (>= 1.3.12, < 2.0)
136
140
  grpc (~> 1.27)
137
- i18n (1.8.10)
141
+ i18n (1.10.0)
138
142
  concurrent-ruby (~> 1.0)
139
- jwt (2.2.3)
140
- loofah (2.12.0)
143
+ jwt (2.3.0)
144
+ loofah (2.14.0)
141
145
  crass (~> 1.0.2)
142
146
  nokogiri (>= 1.5.9)
143
147
  mail (2.7.1)
@@ -145,82 +149,85 @@ GEM
145
149
  marcel (1.0.2)
146
150
  memoist (0.16.2)
147
151
  method_source (1.0.0)
148
- mini_mime (1.1.1)
149
- mini_portile2 (2.6.1)
150
- minitest (5.14.4)
152
+ mini_mime (1.1.2)
153
+ mini_portile2 (2.8.0)
154
+ minitest (5.15.0)
151
155
  multi_json (1.15.0)
152
156
  multipart-post (2.1.1)
153
157
  nio4r (2.5.8)
154
- nokogiri (1.12.5)
155
- mini_portile2 (~> 2.6.1)
158
+ nokogiri (1.13.3)
159
+ mini_portile2 (~> 2.8.0)
156
160
  racc (~> 1.4)
157
- os (1.1.1)
161
+ os (1.1.4)
158
162
  public_suffix (4.0.6)
159
- racc (1.5.2)
163
+ puma (5.6.4)
164
+ nio4r (~> 2.0)
165
+ racc (1.6.0)
160
166
  rack (2.2.3)
161
167
  rack-test (1.1.0)
162
168
  rack (>= 1.0, < 3)
163
- rails (6.0.4.1)
164
- actioncable (= 6.0.4.1)
165
- actionmailbox (= 6.0.4.1)
166
- actionmailer (= 6.0.4.1)
167
- actionpack (= 6.0.4.1)
168
- actiontext (= 6.0.4.1)
169
- actionview (= 6.0.4.1)
170
- activejob (= 6.0.4.1)
171
- activemodel (= 6.0.4.1)
172
- activerecord (= 6.0.4.1)
173
- activestorage (= 6.0.4.1)
174
- activesupport (= 6.0.4.1)
169
+ rails (6.0.4.7)
170
+ actioncable (= 6.0.4.7)
171
+ actionmailbox (= 6.0.4.7)
172
+ actionmailer (= 6.0.4.7)
173
+ actionpack (= 6.0.4.7)
174
+ actiontext (= 6.0.4.7)
175
+ actionview (= 6.0.4.7)
176
+ activejob (= 6.0.4.7)
177
+ activemodel (= 6.0.4.7)
178
+ activerecord (= 6.0.4.7)
179
+ activestorage (= 6.0.4.7)
180
+ activesupport (= 6.0.4.7)
175
181
  bundler (>= 1.3.0)
176
- railties (= 6.0.4.1)
182
+ railties (= 6.0.4.7)
177
183
  sprockets-rails (>= 2.0.0)
178
184
  rails-dom-testing (2.0.3)
179
185
  activesupport (>= 4.2.0)
180
186
  nokogiri (>= 1.6)
181
187
  rails-html-sanitizer (1.4.2)
182
188
  loofah (~> 2.3)
183
- railties (6.0.4.1)
184
- actionpack (= 6.0.4.1)
185
- activesupport (= 6.0.4.1)
189
+ railties (6.0.4.7)
190
+ actionpack (= 6.0.4.7)
191
+ activesupport (= 6.0.4.7)
186
192
  method_source
187
193
  rake (>= 0.8.7)
188
194
  thor (>= 0.20.3, < 2.0)
189
195
  rake (13.0.6)
190
196
  retriable (3.1.2)
191
197
  ruby2_keywords (0.0.5)
192
- signet (0.16.0)
198
+ signet (0.16.1)
193
199
  addressable (~> 2.8)
194
- faraday (>= 0.17.3, < 2.0)
200
+ faraday (>= 0.17.5, < 3.0)
195
201
  jwt (>= 1.5, < 3.0)
196
202
  multi_json (~> 1.10)
197
- sprockets (4.0.2)
203
+ sprockets (4.0.3)
198
204
  concurrent-ruby (~> 1.0)
199
205
  rack (> 1, < 3)
200
- sprockets-rails (3.2.2)
201
- actionpack (>= 4.0)
202
- activesupport (>= 4.0)
206
+ sprockets-rails (3.4.2)
207
+ actionpack (>= 5.2)
208
+ activesupport (>= 5.2)
203
209
  sprockets (>= 3.0.0)
204
210
  sqlite3 (1.4.2)
205
- thor (1.1.0)
211
+ thor (1.2.1)
206
212
  thread_safe (0.3.6)
207
213
  tzinfo (1.2.9)
208
214
  thread_safe (~> 0.1)
209
215
  websocket-driver (0.7.5)
210
216
  websocket-extensions (>= 0.1.0)
211
217
  websocket-extensions (0.1.5)
212
- zeitwerk (2.4.2)
218
+ zeitwerk (2.5.4)
213
219
 
214
220
  PLATFORMS
215
221
  ruby
216
222
 
217
223
  DEPENDENCIES
218
224
  cloudenvoy!
225
+ puma (~> 5.6.4)
219
226
  rails (~> 6.0.2)
220
227
  sqlite3
221
228
 
222
229
  RUBY VERSION
223
- ruby 2.5.5p157
230
+ ruby 3.0.0p0
224
231
 
225
232
  BUNDLED WITH
226
- 2.2.26
233
+ 2.3.4
@@ -12,6 +12,10 @@
12
12
  HelloPublisher.publish('Some message')
13
13
  ```
14
14
  7. Tail the logs to see how message get processed by `HelloSubscriber`
15
+ 8. Try sending multiple messages at once:
16
+ ```ruby
17
+ HelloPublisher.publish_all(['message1', 'message2', 'message3'])
18
+ ```
15
19
 
16
20
  ## Run using GCP Pub/Sub
17
21
 
@@ -22,7 +26,7 @@ HelloPublisher.publish('Some message')
22
26
  * Add the configuration of your GCP Pub/Sub
23
27
  * Set `config.processor_host` to the ngrok http or https url
24
28
  * Set `config.mode` to `:production`
25
- 5. Launch the server: `foreman start web`
29
+ 5. Launch the server: `foreman start`
26
30
  6. Open a Rails console: `rails c`
27
31
  7. Publish messages
28
32
  ```ruby
@@ -11,6 +11,6 @@ class HelloSubscriber
11
11
  # @param [Cloudenvoy::Message] message The message to process.
12
12
  #
13
13
  def process(message)
14
- logger.info("Received message #{message.payload.dig('content')}")
14
+ logger.info("Received message #{message.payload['content']}")
15
15
  end
16
16
  end
@@ -83,7 +83,7 @@ Rails.application.configure do
83
83
  # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
84
84
 
85
85
  if ENV['RAILS_LOG_TO_STDOUT'].present?
86
- logger = ActiveSupport::Logger.new(STDOUT)
86
+ logger = ActiveSupport::Logger.new($stdout)
87
87
  logger.formatter = config.log_formatter
88
88
  config.logger = ActiveSupport::TaggedLogging.new(logger)
89
89
  end
@@ -6,17 +6,17 @@
6
6
  # the maximum value specified for Puma. Default is set to 5 threads for minimum
7
7
  # and maximum; this matches the default thread size of Active Record.
8
8
  #
9
- max_threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
9
+ max_threads_count = ENV.fetch('RAILS_MAX_THREADS', 5)
10
10
  min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count }
11
11
  threads min_threads_count, max_threads_count
12
12
 
13
13
  # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
14
14
  #
15
- port ENV.fetch('PORT') { 3000 }
15
+ port ENV.fetch('PORT', 3000)
16
16
 
17
17
  # Specifies the `environment` that Puma will run in.
18
18
  #
19
- environment ENV.fetch('RAILS_ENV') { 'development' }
19
+ environment ENV.fetch('RAILS_ENV', 'development')
20
20
 
21
21
  # Specifies the number of `workers` to boot in clustered mode.
22
22
  # Workers are forked web server processes. If using threads and workers together
@@ -3,11 +3,14 @@
3
3
  source 'https://rubygems.org'
4
4
  git_source(:github) { |repo| "https://github.com/#{repo}.git" }
5
5
 
6
- ruby '2.5.5'
6
+ ruby '3.0.0'
7
7
 
8
8
  # Web framework
9
9
  gem 'sinatra'
10
10
 
11
+ # Server
12
+ gem 'puma', '~> 5.6.4'
13
+
11
14
  # Support rake tasks
12
15
  gem 'rake'
13
16
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- cloudenvoy (0.4.1)
4
+ cloudenvoy (0.5.0)
5
5
  activesupport
6
6
  google-cloud-pubsub (~> 2.0)
7
7
  jwt
@@ -10,35 +10,38 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activesupport (6.1.4.1)
13
+ activesupport (7.0.2.3)
14
14
  concurrent-ruby (~> 1.0, >= 1.0.2)
15
15
  i18n (>= 1.6, < 2)
16
16
  minitest (>= 5.1)
17
17
  tzinfo (~> 2.0)
18
- zeitwerk (~> 2.3)
19
18
  addressable (2.8.0)
20
19
  public_suffix (>= 2.0.2, < 5.0)
21
20
  concurrent-ruby (1.1.9)
22
- faraday (1.8.0)
21
+ faraday (1.10.0)
23
22
  faraday-em_http (~> 1.0)
24
23
  faraday-em_synchrony (~> 1.0)
25
24
  faraday-excon (~> 1.1)
26
- faraday-httpclient (~> 1.0.1)
25
+ faraday-httpclient (~> 1.0)
26
+ faraday-multipart (~> 1.0)
27
27
  faraday-net_http (~> 1.0)
28
- faraday-net_http_persistent (~> 1.1)
28
+ faraday-net_http_persistent (~> 1.0)
29
29
  faraday-patron (~> 1.0)
30
30
  faraday-rack (~> 1.0)
31
- multipart-post (>= 1.2, < 3)
31
+ faraday-retry (~> 1.0)
32
32
  ruby2_keywords (>= 0.0.4)
33
33
  faraday-em_http (1.0.0)
34
34
  faraday-em_synchrony (1.0.0)
35
35
  faraday-excon (1.1.0)
36
36
  faraday-httpclient (1.0.1)
37
+ faraday-multipart (1.0.3)
38
+ multipart-post (>= 1.2, < 3)
37
39
  faraday-net_http (1.0.1)
38
40
  faraday-net_http_persistent (1.2.0)
39
41
  faraday-patron (1.0.0)
40
42
  faraday-rack (1.0.0)
41
- gapic-common (0.7.0)
43
+ faraday-retry (1.0.3)
44
+ gapic-common (0.8.0)
42
45
  faraday (~> 1.3)
43
46
  google-protobuf (~> 3.14)
44
47
  googleapis-common-protos (>= 1.3.11, < 2.a)
@@ -51,77 +54,86 @@ GEM
51
54
  google-cloud-env (1.5.0)
52
55
  faraday (>= 0.17.3, < 2.0)
53
56
  google-cloud-errors (1.2.0)
54
- google-cloud-pubsub (2.8.1)
57
+ google-cloud-pubsub (2.9.1)
55
58
  concurrent-ruby (~> 1.1)
56
59
  google-cloud-core (~> 1.5)
57
60
  google-cloud-pubsub-v1 (~> 0.0)
58
- google-cloud-pubsub-v1 (0.6.0)
61
+ google-cloud-pubsub-v1 (0.7.1)
59
62
  gapic-common (>= 0.7, < 2.a)
60
63
  google-cloud-errors (~> 1.0)
61
64
  grpc-google-iam-v1 (>= 0.6.10, < 2.a)
62
- google-protobuf (3.18.0-universal-darwin)
65
+ google-protobuf (3.19.4-x86_64-darwin)
66
+ google-protobuf (3.19.4-x86_64-linux)
63
67
  googleapis-common-protos (1.3.12)
64
68
  google-protobuf (~> 3.14)
65
69
  googleapis-common-protos-types (~> 1.2)
66
70
  grpc (~> 1.27)
67
- googleapis-common-protos-types (1.2.0)
71
+ googleapis-common-protos-types (1.3.0)
68
72
  google-protobuf (~> 3.14)
69
- googleauth (1.0.0)
70
- faraday (>= 0.17.3, < 2.0)
73
+ googleauth (1.1.2)
74
+ faraday (>= 0.17.3, < 3.a)
71
75
  jwt (>= 1.4, < 3.0)
72
76
  memoist (~> 0.16)
73
77
  multi_json (~> 1.11)
74
78
  os (>= 0.9, < 2.0)
75
79
  signet (>= 0.16, < 2.a)
76
- grpc (1.40.0-universal-darwin)
77
- google-protobuf (~> 3.15)
80
+ grpc (1.43.1-universal-darwin)
81
+ google-protobuf (~> 3.18)
82
+ googleapis-common-protos-types (~> 1.0)
83
+ grpc (1.43.1-x86_64-linux)
84
+ google-protobuf (~> 3.18)
78
85
  googleapis-common-protos-types (~> 1.0)
79
86
  grpc-google-iam-v1 (1.0.0)
80
87
  google-protobuf (~> 3.14)
81
88
  googleapis-common-protos (>= 1.3.12, < 2.0)
82
89
  grpc (~> 1.27)
83
- i18n (1.8.10)
90
+ i18n (1.10.0)
84
91
  concurrent-ruby (~> 1.0)
85
- jwt (2.2.3)
92
+ jwt (2.3.0)
86
93
  memoist (0.16.2)
87
- minitest (5.14.4)
94
+ minitest (5.15.0)
88
95
  multi_json (1.15.0)
89
96
  multipart-post (2.1.1)
90
97
  mustermann (1.1.1)
91
98
  ruby2_keywords (~> 0.0.1)
92
- os (1.1.1)
99
+ nio4r (2.5.8)
100
+ os (1.1.4)
93
101
  public_suffix (4.0.6)
102
+ puma (5.6.4)
103
+ nio4r (~> 2.0)
94
104
  rack (2.2.3)
95
- rack-protection (2.1.0)
105
+ rack-protection (2.2.0)
96
106
  rack
97
107
  rake (13.0.6)
98
108
  retriable (3.1.2)
99
109
  ruby2_keywords (0.0.5)
100
- signet (0.16.0)
110
+ signet (0.16.1)
101
111
  addressable (~> 2.8)
102
- faraday (>= 0.17.3, < 2.0)
112
+ faraday (>= 0.17.5, < 3.0)
103
113
  jwt (>= 1.5, < 3.0)
104
114
  multi_json (~> 1.10)
105
- sinatra (2.1.0)
115
+ sinatra (2.2.0)
106
116
  mustermann (~> 1.0)
107
117
  rack (~> 2.2)
108
- rack-protection (= 2.1.0)
118
+ rack-protection (= 2.2.0)
109
119
  tilt (~> 2.0)
110
120
  tilt (2.0.10)
111
121
  tzinfo (2.0.4)
112
122
  concurrent-ruby (~> 1.0)
113
- zeitwerk (2.4.2)
114
123
 
115
124
  PLATFORMS
116
125
  x86_64-darwin-17
126
+ x86_64-darwin-19
127
+ x86_64-linux
117
128
 
118
129
  DEPENDENCIES
119
130
  cloudenvoy!
131
+ puma (~> 5.6.4)
120
132
  rake
121
133
  sinatra
122
134
 
123
135
  RUBY VERSION
124
- ruby 2.5.5p157
136
+ ruby 3.0.0p0
125
137
 
126
138
  BUNDLED WITH
127
- 2.2.26
139
+ 2.3.4
@@ -17,6 +17,10 @@ Cloudenvoy.setup_subscribers
17
17
  HelloPublisher.publish('Some message')
18
18
  ```
19
19
  8. Tail the logs to see how message get processed by `HelloSubscriber`
20
+ 9. Try sending multiple messages at once:
21
+ ```ruby
22
+ HelloPublisher.publish_all(['message1', 'message2', 'message3'])
23
+ ```
20
24
 
21
25
  ## Run using GCP Pub/Sub
22
26
 
@@ -11,6 +11,6 @@ class HelloSubscriber
11
11
  # @param [Cloudenvoy::Message] message The message to process.
12
12
  #
13
13
  def process(message)
14
- logger.info("Received message #{message.payload.dig('content')}")
14
+ logger.info("Received message #{message.payload['content']}")
15
15
  end
16
16
  end
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Force logging to be realtime
4
- STDOUT.sync = true
4
+ $stdout.sync = true
5
5
 
6
6
  # Require project files
7
7
  require 'sinatra'
8
- Dir.glob('./config/initializers/*.rb').each { |file| require file }
9
- Dir.glob('./app/publishers/*.rb').each { |file| require file }
10
- Dir.glob('./app/subscribers/*.rb').each { |file| require file }
8
+ Dir.glob('./config/initializers/*.rb').sort.each { |file| require file }
9
+ Dir.glob('./app/publishers/*.rb').sort.each { |file| require file }
10
+ Dir.glob('./app/subscribers/*.rb').sort.each { |file| require file }
11
11
 
12
12
  #---------------------------------------------------
13
13
  # Routes
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_RETRY: "1"
@@ -3,5 +3,6 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "rails", "5.2"
6
+ gem "rspec-rails"
6
7
 
7
8
  gemspec path: "../"
@@ -3,5 +3,6 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "rails", "6.0"
6
+ gem "rspec-rails"
6
7
 
7
8
  gemspec path: "../"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "6.1"
6
+ gem "rspec-rails"
7
+
8
+ gemspec path: "../"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "7.0"
6
+ gem "rspec-rails"
7
+
8
+ gemspec path: "../"
@@ -2,6 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
+ gem "activesupport", "6.1"
5
6
  gem "semantic_logger", "3.4.1"
6
7
 
7
8
  gemspec path: "../"
@@ -2,6 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
+ gem "activesupport", "6.1"
5
6
  gem "semantic_logger", "4.6.1"
6
7
 
7
8
  gemspec path: "../"
@@ -2,6 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
+ gem "activesupport", "6.1"
5
6
  gem "semantic_logger", "4.7.0"
6
7
 
7
8
  gemspec path: "../"
@@ -2,6 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
+ gem "activesupport", "6.1"
5
6
  gem "semantic_logger", "4.7.2"
6
7
 
7
8
  gemspec path: "../"