rabbit_messaging 0.9.0 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +51 -0
- data/.gitignore +3 -2
- data/.rubocop.yml +4 -0
- data/CHANGELOG.md +8 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +278 -0
- data/README.md +20 -4
- data/lib/rabbit/daemon.rb +23 -18
- data/lib/rabbit/publishing/message.rb +0 -2
- data/lib/rabbit/publishing.rb +4 -4
- data/lib/rabbit/receiving/receive.rb +5 -1
- data/lib/rabbit/version.rb +1 -1
- data/lib/rabbit.rb +1 -1
- data/log/.keep +0 -0
- data/rabbit_messaging.gemspec +2 -3
- metadata +17 -29
- data/.travis.yml +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dca68fa90fcf90bd527ddee510fb310b1a4fdf5cdeceb6c94d0cc46bf2fe8a02
|
4
|
+
data.tar.gz: 301d2325d4101516a1e64fd5b27297f67c56d5c0c6f0eaebfb77a9169c91cdbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adfbd28db124c1152477903d0605c09119dda144f97ffaf800c2d44e9d098d1bea56536e69851e02fde8217d42030f040466f0fdf590b338d99d7c3ae0a16178
|
7
|
+
data.tar.gz: 627a4071f33ebb53c661a46f043ec383ab09ad5bfbbf19c9a6e1a24af03aaefe150cd4f564719feac71ec27dca8fc6ea25d3398430f0f86ebe25a31cea0d4f58
|
@@ -0,0 +1,51 @@
|
|
1
|
+
name: Test
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
full-check:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
|
9
|
+
# We want to run on external PRs, but not on our own internal PRs as they'll be run on push event
|
10
|
+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'umbrellio/rabbit_messaging'
|
11
|
+
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v2
|
14
|
+
- uses: ruby/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
ruby-version: "3.0"
|
17
|
+
bundler-cache: true
|
18
|
+
- name: Run Linter
|
19
|
+
run: bundle exec rubocop
|
20
|
+
- name: Run audit
|
21
|
+
run: bundle exec rake bundle:audit
|
22
|
+
- name: Run specs
|
23
|
+
run: bundle exec rspec
|
24
|
+
- name: Coveralls
|
25
|
+
uses: coverallsapp/github-action@master
|
26
|
+
with:
|
27
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
28
|
+
specs:
|
29
|
+
runs-on: ubuntu-latest
|
30
|
+
continue-on-error: ${{ matrix.experimental }}
|
31
|
+
|
32
|
+
# We want to run on external PRs, but not on our own internal PRs as they'll be run on push event
|
33
|
+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'umbrellio/rabbit_messaging'
|
34
|
+
|
35
|
+
strategy:
|
36
|
+
fail-fast: false
|
37
|
+
matrix:
|
38
|
+
ruby: ["2.6", "2.7", "3.0"]
|
39
|
+
experimental: [false]
|
40
|
+
include:
|
41
|
+
- ruby: head
|
42
|
+
experimental: true
|
43
|
+
|
44
|
+
steps:
|
45
|
+
- uses: actions/checkout@v2
|
46
|
+
- uses: ruby/setup-ruby@v1
|
47
|
+
with:
|
48
|
+
ruby-version: ${{ matrix.ruby }}
|
49
|
+
bundler-cache: true
|
50
|
+
- name: Run specs
|
51
|
+
run: bundle exec rspec
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## [0.11.0] - 2021-05-05
|
5
|
+
### Added
|
6
|
+
- `Rabbit.config.receiving_job_class_callable` now receives the full message context (with `message`, `delivery_info` and `arguments` (see the `Rabbit::Receiving::Receive`));
|
7
|
+
|
8
|
+
## [0.10.0] - 2021-03-05
|
9
|
+
### Added
|
10
|
+
- logging message headers
|
11
|
+
|
4
12
|
## [0.9.0] - 2020-11-18
|
5
13
|
### Added
|
6
14
|
- configurable publish skipping (previous iteration just skipped in development)
|
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,278 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
rabbit_messaging (0.12.1)
|
5
|
+
bunny (~> 2.0)
|
6
|
+
lamian
|
7
|
+
rails (>= 5.2)
|
8
|
+
sneakers (~> 2.0)
|
9
|
+
tainbox
|
10
|
+
|
11
|
+
GEM
|
12
|
+
remote: https://rubygems.org/
|
13
|
+
specs:
|
14
|
+
actioncable (6.1.4.4)
|
15
|
+
actionpack (= 6.1.4.4)
|
16
|
+
activesupport (= 6.1.4.4)
|
17
|
+
nio4r (~> 2.0)
|
18
|
+
websocket-driver (>= 0.6.1)
|
19
|
+
actionmailbox (6.1.4.4)
|
20
|
+
actionpack (= 6.1.4.4)
|
21
|
+
activejob (= 6.1.4.4)
|
22
|
+
activerecord (= 6.1.4.4)
|
23
|
+
activestorage (= 6.1.4.4)
|
24
|
+
activesupport (= 6.1.4.4)
|
25
|
+
mail (>= 2.7.1)
|
26
|
+
actionmailer (6.1.4.4)
|
27
|
+
actionpack (= 6.1.4.4)
|
28
|
+
actionview (= 6.1.4.4)
|
29
|
+
activejob (= 6.1.4.4)
|
30
|
+
activesupport (= 6.1.4.4)
|
31
|
+
mail (~> 2.5, >= 2.5.4)
|
32
|
+
rails-dom-testing (~> 2.0)
|
33
|
+
actionpack (6.1.4.4)
|
34
|
+
actionview (= 6.1.4.4)
|
35
|
+
activesupport (= 6.1.4.4)
|
36
|
+
rack (~> 2.0, >= 2.0.9)
|
37
|
+
rack-test (>= 0.6.3)
|
38
|
+
rails-dom-testing (~> 2.0)
|
39
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
40
|
+
actiontext (6.1.4.4)
|
41
|
+
actionpack (= 6.1.4.4)
|
42
|
+
activerecord (= 6.1.4.4)
|
43
|
+
activestorage (= 6.1.4.4)
|
44
|
+
activesupport (= 6.1.4.4)
|
45
|
+
nokogiri (>= 1.8.5)
|
46
|
+
actionview (6.1.4.4)
|
47
|
+
activesupport (= 6.1.4.4)
|
48
|
+
builder (~> 3.1)
|
49
|
+
erubi (~> 1.4)
|
50
|
+
rails-dom-testing (~> 2.0)
|
51
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
52
|
+
activejob (6.1.4.4)
|
53
|
+
activesupport (= 6.1.4.4)
|
54
|
+
globalid (>= 0.3.6)
|
55
|
+
activemodel (6.1.4.4)
|
56
|
+
activesupport (= 6.1.4.4)
|
57
|
+
activerecord (6.1.4.4)
|
58
|
+
activemodel (= 6.1.4.4)
|
59
|
+
activesupport (= 6.1.4.4)
|
60
|
+
activestorage (6.1.4.4)
|
61
|
+
actionpack (= 6.1.4.4)
|
62
|
+
activejob (= 6.1.4.4)
|
63
|
+
activerecord (= 6.1.4.4)
|
64
|
+
activesupport (= 6.1.4.4)
|
65
|
+
marcel (~> 1.0.0)
|
66
|
+
mini_mime (>= 1.1.0)
|
67
|
+
activesupport (6.1.4.4)
|
68
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
69
|
+
i18n (>= 1.6, < 2)
|
70
|
+
minitest (>= 5.1)
|
71
|
+
tzinfo (~> 2.0)
|
72
|
+
zeitwerk (~> 2.3)
|
73
|
+
amq-protocol (2.3.2)
|
74
|
+
ast (2.4.2)
|
75
|
+
builder (3.2.4)
|
76
|
+
bundler-audit (0.9.0.1)
|
77
|
+
bundler (>= 1.2.0, < 3)
|
78
|
+
thor (~> 1.0)
|
79
|
+
bunny (2.19.0)
|
80
|
+
amq-protocol (~> 2.3, >= 2.3.1)
|
81
|
+
sorted_set (~> 1, >= 1.0.2)
|
82
|
+
coderay (1.1.3)
|
83
|
+
concurrent-ruby (1.1.9)
|
84
|
+
crass (1.0.6)
|
85
|
+
diff-lcs (1.4.4)
|
86
|
+
docile (1.4.0)
|
87
|
+
erubi (1.10.0)
|
88
|
+
faraday (1.8.0)
|
89
|
+
faraday-em_http (~> 1.0)
|
90
|
+
faraday-em_synchrony (~> 1.0)
|
91
|
+
faraday-excon (~> 1.1)
|
92
|
+
faraday-httpclient (~> 1.0.1)
|
93
|
+
faraday-net_http (~> 1.0)
|
94
|
+
faraday-net_http_persistent (~> 1.1)
|
95
|
+
faraday-patron (~> 1.0)
|
96
|
+
faraday-rack (~> 1.0)
|
97
|
+
multipart-post (>= 1.2, < 3)
|
98
|
+
ruby2_keywords (>= 0.0.4)
|
99
|
+
faraday-em_http (1.0.0)
|
100
|
+
faraday-em_synchrony (1.0.0)
|
101
|
+
faraday-excon (1.1.0)
|
102
|
+
faraday-httpclient (1.0.1)
|
103
|
+
faraday-net_http (1.0.1)
|
104
|
+
faraday-net_http_persistent (1.2.0)
|
105
|
+
faraday-patron (1.0.0)
|
106
|
+
faraday-rack (1.0.0)
|
107
|
+
globalid (1.0.0)
|
108
|
+
activesupport (>= 5.0)
|
109
|
+
i18n (1.8.11)
|
110
|
+
concurrent-ruby (~> 1.0)
|
111
|
+
lamian (1.5.0)
|
112
|
+
rails (>= 4.2)
|
113
|
+
loofah (2.13.0)
|
114
|
+
crass (~> 1.0.2)
|
115
|
+
nokogiri (>= 1.5.9)
|
116
|
+
mail (2.7.1)
|
117
|
+
mini_mime (>= 0.1.1)
|
118
|
+
marcel (1.0.2)
|
119
|
+
method_source (1.0.0)
|
120
|
+
mini_mime (1.1.2)
|
121
|
+
mini_portile2 (2.6.1)
|
122
|
+
minitest (5.15.0)
|
123
|
+
multipart-post (2.1.1)
|
124
|
+
nio4r (2.5.8)
|
125
|
+
nokogiri (1.12.5)
|
126
|
+
mini_portile2 (~> 2.6.1)
|
127
|
+
racc (~> 1.4)
|
128
|
+
parallel (1.21.0)
|
129
|
+
parser (3.0.3.2)
|
130
|
+
ast (~> 2.4.1)
|
131
|
+
pry (0.14.1)
|
132
|
+
coderay (~> 1.1)
|
133
|
+
method_source (~> 1.0)
|
134
|
+
racc (1.6.0)
|
135
|
+
rack (2.2.3)
|
136
|
+
rack-test (1.1.0)
|
137
|
+
rack (>= 1.0, < 3)
|
138
|
+
rails (6.1.4.4)
|
139
|
+
actioncable (= 6.1.4.4)
|
140
|
+
actionmailbox (= 6.1.4.4)
|
141
|
+
actionmailer (= 6.1.4.4)
|
142
|
+
actionpack (= 6.1.4.4)
|
143
|
+
actiontext (= 6.1.4.4)
|
144
|
+
actionview (= 6.1.4.4)
|
145
|
+
activejob (= 6.1.4.4)
|
146
|
+
activemodel (= 6.1.4.4)
|
147
|
+
activerecord (= 6.1.4.4)
|
148
|
+
activestorage (= 6.1.4.4)
|
149
|
+
activesupport (= 6.1.4.4)
|
150
|
+
bundler (>= 1.15.0)
|
151
|
+
railties (= 6.1.4.4)
|
152
|
+
sprockets-rails (>= 2.0.0)
|
153
|
+
rails-dom-testing (2.0.3)
|
154
|
+
activesupport (>= 4.2.0)
|
155
|
+
nokogiri (>= 1.6)
|
156
|
+
rails-html-sanitizer (1.4.2)
|
157
|
+
loofah (~> 2.3)
|
158
|
+
railties (6.1.4.4)
|
159
|
+
actionpack (= 6.1.4.4)
|
160
|
+
activesupport (= 6.1.4.4)
|
161
|
+
method_source
|
162
|
+
rake (>= 0.13)
|
163
|
+
thor (~> 1.0)
|
164
|
+
rainbow (3.0.0)
|
165
|
+
rake (13.0.6)
|
166
|
+
rbtree (0.4.4)
|
167
|
+
regexp_parser (2.2.0)
|
168
|
+
rexml (3.2.5)
|
169
|
+
rspec (3.10.0)
|
170
|
+
rspec-core (~> 3.10.0)
|
171
|
+
rspec-expectations (~> 3.10.0)
|
172
|
+
rspec-mocks (~> 3.10.0)
|
173
|
+
rspec-core (3.10.1)
|
174
|
+
rspec-support (~> 3.10.0)
|
175
|
+
rspec-expectations (3.10.1)
|
176
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
177
|
+
rspec-support (~> 3.10.0)
|
178
|
+
rspec-its (1.3.0)
|
179
|
+
rspec-core (>= 3.0.0)
|
180
|
+
rspec-expectations (>= 3.0.0)
|
181
|
+
rspec-mocks (3.10.2)
|
182
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
183
|
+
rspec-support (~> 3.10.0)
|
184
|
+
rspec-support (3.10.3)
|
185
|
+
rubocop (1.17.0)
|
186
|
+
parallel (~> 1.10)
|
187
|
+
parser (>= 3.0.0.0)
|
188
|
+
rainbow (>= 2.2.2, < 4.0)
|
189
|
+
regexp_parser (>= 1.8, < 3.0)
|
190
|
+
rexml
|
191
|
+
rubocop-ast (>= 1.7.0, < 2.0)
|
192
|
+
ruby-progressbar (~> 1.7)
|
193
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
194
|
+
rubocop-ast (1.15.0)
|
195
|
+
parser (>= 3.0.1.1)
|
196
|
+
rubocop-config-umbrellio (1.17.0.53)
|
197
|
+
rubocop (= 1.17.0)
|
198
|
+
rubocop-performance (= 1.10.0)
|
199
|
+
rubocop-rails (= 2.9.1)
|
200
|
+
rubocop-rake (= 0.5.1)
|
201
|
+
rubocop-rspec (= 2.2.0)
|
202
|
+
rubocop-sequel (= 0.2.0)
|
203
|
+
rubocop-performance (1.10.0)
|
204
|
+
rubocop (>= 0.90.0, < 2.0)
|
205
|
+
rubocop-ast (>= 0.4.0)
|
206
|
+
rubocop-rails (2.9.1)
|
207
|
+
activesupport (>= 4.2.0)
|
208
|
+
rack (>= 1.1)
|
209
|
+
rubocop (>= 0.90.0, < 2.0)
|
210
|
+
rubocop-rake (0.5.1)
|
211
|
+
rubocop
|
212
|
+
rubocop-rspec (2.2.0)
|
213
|
+
rubocop (~> 1.0)
|
214
|
+
rubocop-ast (>= 1.1.0)
|
215
|
+
rubocop-sequel (0.2.0)
|
216
|
+
rubocop (~> 1.0)
|
217
|
+
ruby-progressbar (1.11.0)
|
218
|
+
ruby2_keywords (0.0.5)
|
219
|
+
sentry-ruby-core (4.8.1)
|
220
|
+
concurrent-ruby
|
221
|
+
faraday
|
222
|
+
serverengine (2.0.7)
|
223
|
+
sigdump (~> 0.2.2)
|
224
|
+
set (1.0.2)
|
225
|
+
sigdump (0.2.4)
|
226
|
+
simplecov (0.21.2)
|
227
|
+
docile (~> 1.1)
|
228
|
+
simplecov-html (~> 0.11)
|
229
|
+
simplecov_json_formatter (~> 0.1)
|
230
|
+
simplecov-html (0.12.3)
|
231
|
+
simplecov-lcov (0.8.0)
|
232
|
+
simplecov_json_formatter (0.1.3)
|
233
|
+
sneakers (2.11.0)
|
234
|
+
bunny (~> 2.12)
|
235
|
+
concurrent-ruby (~> 1.0)
|
236
|
+
rake
|
237
|
+
serverengine (~> 2.0.5)
|
238
|
+
thor
|
239
|
+
sorted_set (1.0.3)
|
240
|
+
rbtree
|
241
|
+
set (~> 1.0)
|
242
|
+
sprockets (4.0.2)
|
243
|
+
concurrent-ruby (~> 1.0)
|
244
|
+
rack (> 1, < 3)
|
245
|
+
sprockets-rails (3.4.2)
|
246
|
+
actionpack (>= 5.2)
|
247
|
+
activesupport (>= 5.2)
|
248
|
+
sprockets (>= 3.0.0)
|
249
|
+
tainbox (2.1.2)
|
250
|
+
activesupport
|
251
|
+
thor (1.1.0)
|
252
|
+
tzinfo (2.0.4)
|
253
|
+
concurrent-ruby (~> 1.0)
|
254
|
+
unicode-display_width (2.1.0)
|
255
|
+
websocket-driver (0.7.5)
|
256
|
+
websocket-extensions (>= 0.1.0)
|
257
|
+
websocket-extensions (0.1.5)
|
258
|
+
zeitwerk (2.5.1)
|
259
|
+
|
260
|
+
PLATFORMS
|
261
|
+
ruby
|
262
|
+
|
263
|
+
DEPENDENCIES
|
264
|
+
bundler
|
265
|
+
bundler-audit
|
266
|
+
pry
|
267
|
+
rabbit_messaging!
|
268
|
+
rails (~> 6.0)
|
269
|
+
rake
|
270
|
+
rspec
|
271
|
+
rspec-its
|
272
|
+
rubocop-config-umbrellio
|
273
|
+
sentry-ruby-core
|
274
|
+
simplecov (>= 0.21)
|
275
|
+
simplecov-lcov
|
276
|
+
|
277
|
+
BUNDLED WITH
|
278
|
+
2.2.17
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Rabbit (Rabbit Messaging) · [![Gem Version](https://badge.fury.io/rb/rabbit_messaging.svg)](https://badge.fury.io/rb/rabbit_messaging) [![
|
1
|
+
# Rabbit (Rabbit Messaging) · [![Gem Version](https://badge.fury.io/rb/rabbit_messaging.svg)](https://badge.fury.io/rb/rabbit_messaging) [![Coverage Status](https://coveralls.io/repos/github/umbrellio/rabbit_messaging/badge.svg?branch=master)](https://coveralls.io/github/umbrellio/rabbit_messaging?branch=master)
|
2
2
|
|
3
3
|
Provides client and server support for RabbitMQ
|
4
4
|
|
@@ -67,11 +67,27 @@ require "rabbit_messaging"
|
|
67
67
|
|
68
68
|
* `receiving_job_class_callable` (`Proc`)
|
69
69
|
|
70
|
-
Custom ActiveJob subclass to work with received messages.
|
70
|
+
Custom ActiveJob subclass to work with received messages. Receives the following attributes as `kwarg`-arguments:
|
71
|
+
|
72
|
+
* `:arguments` - information about message type (`type`), application id (`app_id`), message id (`message_id`);
|
73
|
+
* `:delivery_info` - information about `exchange`, `routing_key`, etc;
|
74
|
+
* `:message` - received RabbitMQ message (often in a `string` format);
|
75
|
+
|
76
|
+
```ruby
|
77
|
+
{
|
78
|
+
message: '{"hello":"world","foo":"bar"}',
|
79
|
+
delivery_info: { exchange: "some exchange", routing_key: "some_key" },
|
80
|
+
arguments: {
|
81
|
+
type: "some_successful_event",
|
82
|
+
app_id: "some_group.some_app",
|
83
|
+
message_id: "uuid",
|
84
|
+
}
|
85
|
+
}
|
86
|
+
```
|
71
87
|
|
72
88
|
* `exception_notifier` (`Proc`)
|
73
89
|
|
74
|
-
By default, exceptions are reported using `
|
90
|
+
By default, exceptions are reported using `Sentry` (see [sentry gem](https://github.com/getsentry/sentry-ruby)).
|
75
91
|
You can provide your own notifier like this:
|
76
92
|
|
77
93
|
```ruby
|
@@ -81,7 +97,7 @@ require "rabbit_messaging"
|
|
81
97
|
* `before_receiving_hooks, after_receiving_hooks` (`Array of Procs`)
|
82
98
|
|
83
99
|
Before and after hooks with message processing in the middle. Where `before_receiving_hooks` and `after_receiving_hooks` are empty arrays by default.
|
84
|
-
|
100
|
+
|
85
101
|
It's advised to NOT place procs with long execution time inside.
|
86
102
|
|
87
103
|
Setup:
|
data/lib/rabbit/daemon.rb
CHANGED
@@ -11,30 +11,18 @@ module Rabbit
|
|
11
11
|
module Daemon
|
12
12
|
extend self
|
13
13
|
|
14
|
-
def run
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
exchange: Rabbit.config.app_name,
|
20
|
-
hooks: Rabbit.config.hooks,
|
21
|
-
supervisor: true,
|
22
|
-
daemonize: false,
|
23
|
-
exit_on_detach: true,
|
24
|
-
**config,
|
25
|
-
)
|
26
|
-
|
27
|
-
unless Sneakers.logger
|
28
|
-
Sneakers.logger = Logger.new(Rails.root.join("log", "sneakers.log"))
|
29
|
-
Sneakers.logger.level = Logger::DEBUG
|
30
|
-
Lamian.extend_logger(Sneakers.logger)
|
14
|
+
def run(logger: Sneakers.logger)
|
15
|
+
unless logger
|
16
|
+
logger = Logger.new(Rails.root.join("log", "sneakers.log"))
|
17
|
+
logger.level = Logger::DEBUG
|
18
|
+
Lamian.extend_logger(logger)
|
31
19
|
end
|
32
20
|
|
21
|
+
Sneakers.configure(**sneakers_config(logger: logger))
|
33
22
|
Sneakers.server = true
|
34
23
|
|
35
24
|
Rabbit.config.validate!
|
36
25
|
Receiving::Worker.from_queue(Rabbit.config.read_queue)
|
37
|
-
|
38
26
|
Sneakers::Runner.new([Receiving::Worker]).run
|
39
27
|
end
|
40
28
|
|
@@ -46,5 +34,22 @@ module Rabbit
|
|
46
34
|
bunny_config = config.delete(:bunny_options).to_h.symbolize_keys
|
47
35
|
Bunny.new(bunny_config)
|
48
36
|
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def sneakers_config(logger:)
|
41
|
+
{
|
42
|
+
connection: connection,
|
43
|
+
env: Rails.env,
|
44
|
+
exchange_type: :direct,
|
45
|
+
exchange: Rabbit.config.app_name,
|
46
|
+
hooks: Rabbit.config.hooks,
|
47
|
+
supervisor: true,
|
48
|
+
daemonize: false,
|
49
|
+
exit_on_detach: true,
|
50
|
+
log: logger,
|
51
|
+
**config,
|
52
|
+
}
|
53
|
+
end
|
49
54
|
end
|
50
55
|
end
|
data/lib/rabbit/publishing.rb
CHANGED
@@ -49,12 +49,12 @@ module Rabbit
|
|
49
49
|
def log(message)
|
50
50
|
@logger ||= Rabbit.config.publish_logger
|
51
51
|
|
52
|
-
|
53
|
-
message.real_exchange_name, message.routing_key, message.
|
54
|
-
message.confirm_select? ? "confirm" : "no-confirm"
|
52
|
+
metadata = [
|
53
|
+
message.real_exchange_name, message.routing_key, message.headers,
|
54
|
+
message.event, message.confirm_select? ? "confirm" : "no-confirm"
|
55
55
|
]
|
56
56
|
|
57
|
-
@logger.debug "#{
|
57
|
+
@logger.debug "#{metadata.join ' / '}: #{message.data}"
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -57,6 +57,10 @@ class Rabbit::Receiving::Receive
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def job_class
|
60
|
-
Rabbit.config.receiving_job_class_callable&.call
|
60
|
+
Rabbit.config.receiving_job_class_callable&.call(
|
61
|
+
message: message,
|
62
|
+
delivery_info: delivery_info,
|
63
|
+
arguments: arguments,
|
64
|
+
) || Rabbit::Receiving::Job
|
61
65
|
end
|
62
66
|
end
|
data/lib/rabbit/version.rb
CHANGED
data/lib/rabbit.rb
CHANGED
data/log/.keep
ADDED
File without changes
|
data/rabbit_messaging.gemspec
CHANGED
@@ -20,7 +20,6 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
22
|
spec.add_runtime_dependency "bunny", "~> 2.0"
|
23
|
-
spec.add_runtime_dependency "exception_notification"
|
24
23
|
spec.add_runtime_dependency "lamian"
|
25
24
|
spec.add_runtime_dependency "rails", ">= 5.2"
|
26
25
|
spec.add_runtime_dependency "sneakers", "~> 2.0"
|
@@ -28,11 +27,11 @@ Gem::Specification.new do |spec|
|
|
28
27
|
|
29
28
|
spec.add_development_dependency "bundler"
|
30
29
|
spec.add_development_dependency "bundler-audit"
|
31
|
-
spec.add_development_dependency "coveralls", ">=0.8"
|
32
30
|
spec.add_development_dependency "pry"
|
33
31
|
spec.add_development_dependency "rake"
|
34
32
|
spec.add_development_dependency "rspec"
|
35
33
|
spec.add_development_dependency "rspec-its"
|
36
34
|
spec.add_development_dependency "rubocop-config-umbrellio"
|
37
|
-
spec.add_development_dependency "simplecov"
|
35
|
+
spec.add_development_dependency "simplecov", ">= 0.21"
|
36
|
+
spec.add_development_dependency "simplecov-lcov"
|
38
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabbit_messaging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Umbrellio
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: exception_notification
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: lamian
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -123,21 +109,21 @@ dependencies:
|
|
123
109
|
- !ruby/object:Gem::Version
|
124
110
|
version: '0'
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
112
|
+
name: pry
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
128
114
|
requirements:
|
129
115
|
- - ">="
|
130
116
|
- !ruby/object:Gem::Version
|
131
|
-
version: '0
|
117
|
+
version: '0'
|
132
118
|
type: :development
|
133
119
|
prerelease: false
|
134
120
|
version_requirements: !ruby/object:Gem::Requirement
|
135
121
|
requirements:
|
136
122
|
- - ">="
|
137
123
|
- !ruby/object:Gem::Version
|
138
|
-
version: '0
|
124
|
+
version: '0'
|
139
125
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
126
|
+
name: rake
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
142
128
|
requirements:
|
143
129
|
- - ">="
|
@@ -151,7 +137,7 @@ dependencies:
|
|
151
137
|
- !ruby/object:Gem::Version
|
152
138
|
version: '0'
|
153
139
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
140
|
+
name: rspec
|
155
141
|
requirement: !ruby/object:Gem::Requirement
|
156
142
|
requirements:
|
157
143
|
- - ">="
|
@@ -165,7 +151,7 @@ dependencies:
|
|
165
151
|
- !ruby/object:Gem::Version
|
166
152
|
version: '0'
|
167
153
|
- !ruby/object:Gem::Dependency
|
168
|
-
name: rspec
|
154
|
+
name: rspec-its
|
169
155
|
requirement: !ruby/object:Gem::Requirement
|
170
156
|
requirements:
|
171
157
|
- - ">="
|
@@ -179,7 +165,7 @@ dependencies:
|
|
179
165
|
- !ruby/object:Gem::Version
|
180
166
|
version: '0'
|
181
167
|
- !ruby/object:Gem::Dependency
|
182
|
-
name:
|
168
|
+
name: rubocop-config-umbrellio
|
183
169
|
requirement: !ruby/object:Gem::Requirement
|
184
170
|
requirements:
|
185
171
|
- - ">="
|
@@ -193,21 +179,21 @@ dependencies:
|
|
193
179
|
- !ruby/object:Gem::Version
|
194
180
|
version: '0'
|
195
181
|
- !ruby/object:Gem::Dependency
|
196
|
-
name:
|
182
|
+
name: simplecov
|
197
183
|
requirement: !ruby/object:Gem::Requirement
|
198
184
|
requirements:
|
199
185
|
- - ">="
|
200
186
|
- !ruby/object:Gem::Version
|
201
|
-
version: '0'
|
187
|
+
version: '0.21'
|
202
188
|
type: :development
|
203
189
|
prerelease: false
|
204
190
|
version_requirements: !ruby/object:Gem::Requirement
|
205
191
|
requirements:
|
206
192
|
- - ">="
|
207
193
|
- !ruby/object:Gem::Version
|
208
|
-
version: '0'
|
194
|
+
version: '0.21'
|
209
195
|
- !ruby/object:Gem::Dependency
|
210
|
-
name: simplecov
|
196
|
+
name: simplecov-lcov
|
211
197
|
requirement: !ruby/object:Gem::Requirement
|
212
198
|
requirements:
|
213
199
|
- - ">="
|
@@ -227,12 +213,13 @@ executables: []
|
|
227
213
|
extensions: []
|
228
214
|
extra_rdoc_files: []
|
229
215
|
files:
|
216
|
+
- ".github/workflows/test.yml"
|
230
217
|
- ".gitignore"
|
231
218
|
- ".rspec"
|
232
219
|
- ".rubocop.yml"
|
233
|
-
- ".travis.yml"
|
234
220
|
- CHANGELOG.md
|
235
221
|
- Gemfile
|
222
|
+
- Gemfile.lock
|
236
223
|
- LICENSE.md
|
237
224
|
- README.md
|
238
225
|
- Rakefile
|
@@ -258,6 +245,7 @@ files:
|
|
258
245
|
- lib/rabbit/test_helpers.rb
|
259
246
|
- lib/rabbit/version.rb
|
260
247
|
- lib/rabbit_messaging.rb
|
248
|
+
- log/.keep
|
261
249
|
- rabbit_messaging.gemspec
|
262
250
|
homepage: https://github.com/umbrellio/rabbit_messaging
|
263
251
|
licenses: []
|
@@ -277,7 +265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
277
265
|
- !ruby/object:Gem::Version
|
278
266
|
version: '0'
|
279
267
|
requirements: []
|
280
|
-
rubygems_version: 3.
|
268
|
+
rubygems_version: 3.3.0
|
281
269
|
signing_key:
|
282
270
|
specification_version: 4
|
283
271
|
summary: Rabbit (Rabbit Messaging)
|
data/.travis.yml
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
matrix:
|
3
|
-
fast_finish: true
|
4
|
-
include:
|
5
|
-
- rvm: 2.5
|
6
|
-
- rvm: 2.6
|
7
|
-
- rvm: 2.7
|
8
|
-
- rvm: ruby-head
|
9
|
-
allow_failures:
|
10
|
-
- rvm: ruby-head
|
11
|
-
sudo: false
|
12
|
-
cache: bundler
|
13
|
-
before_install: gem install bundler
|
14
|
-
script:
|
15
|
-
- mkdir log
|
16
|
-
- bundle exec rake bundle:audit
|
17
|
-
- bundle exec rubocop
|
18
|
-
- bundle exec rspec
|