twingly-amqp 6.2.0 → 6.3.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/lib/twingly/amqp/subscription.rb +12 -3
- data/lib/twingly/amqp/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c1cb941ad372e8cbb085f91beeb5c2131411c17555b86ec3271125203c98003c
|
|
4
|
+
data.tar.gz: d00eaff0d89a543c856bef71e7d1e0f034681655a9d97fdcbeb13fa4934f8670
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5b2df6c205c407815c1ed2bb4274655d4c427752190907e32a6e0cc2705761a203b939ac547cca7f3269dc9c7f4151038e637113b6c71cfd3cbc88d6d367a27a
|
|
7
|
+
data.tar.gz: 1357bef533943bacd3c33d856c774937de795da751a6adfa1af4f57f081dae75e2f6811f2235c4a5b307ccdc24457aa12467d0c5dc6d78b07c0a43d66fdd6d0f
|
|
@@ -34,7 +34,7 @@ module Twingly
|
|
|
34
34
|
|
|
35
35
|
@before_handle_message_callback = proc {}
|
|
36
36
|
@on_exception_callback = proc {}
|
|
37
|
-
@on_error_callback = proc {
|
|
37
|
+
@on_error_callback = proc {}
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def each_message(blocking: true, &block)
|
|
@@ -133,11 +133,20 @@ module Twingly
|
|
|
133
133
|
|
|
134
134
|
def subscribe_options
|
|
135
135
|
{
|
|
136
|
-
manual_ack:
|
|
137
|
-
consumer_tag:
|
|
136
|
+
manual_ack: true,
|
|
137
|
+
consumer_tag: consumer_tag,
|
|
138
|
+
on_cancellation: proc { handle_server_cancellation },
|
|
138
139
|
}
|
|
139
140
|
end
|
|
140
141
|
|
|
142
|
+
# Called when the server cancels the consumer, e.g. on consumer timeout (RabbitMQ 4.3+)
|
|
143
|
+
def handle_server_cancellation
|
|
144
|
+
Twingly::AMQP.configuration.logger.warn(
|
|
145
|
+
"Consumer cancelled by the server, stopping subscription to #{@queue_name}"
|
|
146
|
+
)
|
|
147
|
+
@cancel = true
|
|
148
|
+
end
|
|
149
|
+
|
|
141
150
|
def consumer_tag
|
|
142
151
|
tag_name = Socket.gethostname
|
|
143
152
|
@channel.generate_consumer_tag(tag_name)
|
data/lib/twingly/amqp/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: twingly-amqp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 6.
|
|
4
|
+
version: 6.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Twingly AB
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: bunny
|
|
@@ -76,7 +75,6 @@ files:
|
|
|
76
75
|
homepage: https://github.com/twingly/twingly-amqp
|
|
77
76
|
licenses: []
|
|
78
77
|
metadata: {}
|
|
79
|
-
post_install_message:
|
|
80
78
|
rdoc_options: []
|
|
81
79
|
require_paths:
|
|
82
80
|
- lib
|
|
@@ -91,8 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
91
89
|
- !ruby/object:Gem::Version
|
|
92
90
|
version: '0'
|
|
93
91
|
requirements: []
|
|
94
|
-
rubygems_version: 3.
|
|
95
|
-
signing_key:
|
|
92
|
+
rubygems_version: 3.6.9
|
|
96
93
|
specification_version: 4
|
|
97
94
|
summary: Ruby library for talking to RabbitMQ
|
|
98
95
|
test_files: []
|