rabbit_messaging 0.8.1 → 0.9.0
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/CHANGELOG.md +8 -0
- data/README.md +7 -0
- data/lib/rabbit.rb +5 -0
- data/lib/rabbit/publishing.rb +1 -1
- data/lib/rabbit/receiving/job.rb +1 -0
- data/lib/rabbit/receiving/receive.rb +1 -2
- data/lib/rabbit/receiving/worker.rb +2 -1
- data/lib/rabbit/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: cd0a35e07052f1d33c73f5ca2f411d6642f59bcb7c1893097209cde42f056f1c
|
4
|
+
data.tar.gz: 9e677dc5ddcb0f29ccf34942729af2b695c0e26f4e8db350923aa4d173e6990f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c25489a4ca2a39ee509d8dbc479480400ec61c2f20b7b63677c77ff61aa1118c0550a51cfa56a9ccf4e6803a990255e04098984752a712cb32b4d1e7e7e14e95
|
7
|
+
data.tar.gz: 4cc37ce72c23a40534f9fb7d30ac3b2a73516eb50d8e6beeba965ea908b23ef2bce684a04eb5ed260bd8e07f1fb6978fddabde24a8628fb6dc9edb87e023d38c
|
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.9.0] - 2020-11-18
|
5
|
+
### Added
|
6
|
+
- configurable publish skipping (previous iteration just skipped in development)
|
7
|
+
|
8
|
+
### Fixed
|
9
|
+
- fix for receiving (delivery_info and args to hashes)
|
10
|
+
- fix for requiring receiving job
|
11
|
+
|
4
12
|
## [0.8.1] - 2020-11-05
|
5
13
|
### Added
|
6
14
|
- channels pool for manage channels on Publisher connection
|
data/README.md
CHANGED
@@ -58,6 +58,13 @@ require "rabbit_messaging"
|
|
58
58
|
* `:development` environment auto-creates queues and uses default exchange
|
59
59
|
* `:production` environment enables handlers caching and gets maximum strictness
|
60
60
|
|
61
|
+
By default gem skips publishing in test and development environments.
|
62
|
+
If you want to change that then manually set `Rabbit.skip_publishing_in` with an array of environments.
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
Rabbit.skip_publishing_in = %i[test]
|
66
|
+
```
|
67
|
+
|
61
68
|
* `receiving_job_class_callable` (`Proc`)
|
62
69
|
|
63
70
|
Custom ActiveJob subclass to work with received messages.
|
data/lib/rabbit.rb
CHANGED
@@ -25,6 +25,7 @@ module Rabbit
|
|
25
25
|
attribute :exception_notifier, default: -> { default_exception_notifier }
|
26
26
|
attribute :before_receiving_hooks, default: []
|
27
27
|
attribute :after_receiving_hooks, default: []
|
28
|
+
attribute :skip_publishing_in, default: %i[test development]
|
28
29
|
|
29
30
|
attribute :receive_logger, default: lambda {
|
30
31
|
Logger.new(Rails.root.join("log", "incoming_rabbit_messages.log"))
|
@@ -47,6 +48,10 @@ module Rabbit
|
|
47
48
|
end
|
48
49
|
end
|
49
50
|
|
51
|
+
def skip_publish?
|
52
|
+
skip_publishing_in.include?(environment)
|
53
|
+
end
|
54
|
+
|
50
55
|
def app_name
|
51
56
|
[group_id, project_id].join(".")
|
52
57
|
end
|
data/lib/rabbit/publishing.rb
CHANGED
data/lib/rabbit/receiving/job.rb
CHANGED
@@ -9,7 +9,8 @@ class Rabbit::Receiving::Worker
|
|
9
9
|
include Sneakers::Worker
|
10
10
|
|
11
11
|
def work_with_params(message, delivery_info, arguments)
|
12
|
-
|
12
|
+
# args and info have custom rabbit classes, have to convert them to hash
|
13
|
+
receive_message(message, delivery_info.to_h, arguments.to_h)
|
13
14
|
ack!
|
14
15
|
rescue => error
|
15
16
|
handle_error!(error)
|
data/lib/rabbit/version.rb
CHANGED
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.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Umbrellio
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|