pebbles-river 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pebbles/river/version.rb +1 -1
- data/lib/pebbles/river/worker.rb +11 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f7948d260e40b0cecffab90006e922379efd38f
|
4
|
+
data.tar.gz: 4d56560952e7e40282b4c94b8fbd4f9efa77cd30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5345293b105990aa43b48d47124415770ddef300b839a90c32617b0141650d9282d09b1e0319e8b009974115fe33a85c8c6fb28c61bec9e338b70db02ed60e9
|
7
|
+
data.tar.gz: ed800b294e48cf4818a506fb166cba9753fd379aeedf188bea7311afb3cfd192d401ee1e187ad437ab419cb3536023459718b7bc20ebb63a3009e500afea7844
|
data/lib/pebbles/river/worker.rb
CHANGED
@@ -136,6 +136,11 @@ module Pebbles
|
|
136
136
|
def process_message(delivery_info, properties, content)
|
137
137
|
begin
|
138
138
|
message = Message.new(content, delivery_info, queue)
|
139
|
+
rescue InvalidPayloadError => e
|
140
|
+
if @logger
|
141
|
+
@logger.error("Invalid payload, ignoring message: #{e}")
|
142
|
+
reject(delivery_info, requeue: false)
|
143
|
+
end
|
139
144
|
rescue => e
|
140
145
|
ignore_exceptions do
|
141
146
|
reject(delivery_info)
|
@@ -166,11 +171,12 @@ module Pebbles
|
|
166
171
|
end
|
167
172
|
end
|
168
173
|
|
169
|
-
def reject(delivery_info)
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
+
def reject(delivery_info, requeue: nil)
|
175
|
+
if requeue.nil?
|
176
|
+
# Normally requeue, except if we are dead-lettering to another queue, where
|
177
|
+
# requeue = false means to bounce it to DLX.
|
178
|
+
requeue = !@dead_lettered
|
179
|
+
end
|
174
180
|
queue.channel.reject(delivery_info.delivery_tag.to_i, requeue)
|
175
181
|
end
|
176
182
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pebbles-river
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Staubo
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-06-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pebblebed
|