istox 0.1.134 → 0.1.135
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/istox/helpers/subscriber.rb +18 -10
- data/lib/istox/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: ea4ecfc5feab0cbc06336dadb22e0b4070951a0fe4f56293ffa0d1c2ddfe2e41
|
4
|
+
data.tar.gz: 40d4295b9dd6e08e094518681f568c893149031e6632357b9dda239975fdcf56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee86396ae458514e4b432e10b60cce8a2a5d800de2f685e7588338b7d0e63d2add4735566cf2276c147d69f7a0f79f443528e03461d30d3f73128aca255a4d88
|
7
|
+
data.tar.gz: e2f8ca172f526606ce70243a3b93eda0ce33f6a2e3746acd92f7e5300dc4529e9bb6da4dcf46a8661b89c014e1a748438ec579393d341136e1119c18de4f4eec
|
data/Gemfile.lock
CHANGED
@@ -139,17 +139,25 @@ module Istox
|
|
139
139
|
# If retry limit is -1, no retry limit
|
140
140
|
# TODO: No matter the amount of retry limit, send cloudwatch critical alarm if fails after 3 times of retry
|
141
141
|
retry_limit = ::Istox::BunnyBoot.queue_retry_limit consumer_key
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
142
|
+
process = true
|
143
|
+
store = true
|
144
|
+
process = false if metadata[:priority] && retry_limit != -1 && metadata[:priority] >= retry_limit
|
145
|
+
if delivery_info[:routing_key] != queue_name
|
146
|
+
log.debug "Get retry message from other queue #{delivery_info[:routing_key]}, just ignore!!"
|
147
|
+
process = false
|
148
|
+
store = false
|
149
|
+
end
|
150
|
+
if process
|
151
|
+
processing_payload = JSON.parse(payload)
|
152
|
+
processing_payload = ::Istox::CommonHelper.to_open_struct(processing_payload) if ::Istox::BunnyBoot.queue_worker_param_format(consumer_key) == 'open_struct'
|
153
|
+
log.info "Processing in consumer: #{klass}, payload: #{processing_payload.to_h.inspect}"
|
146
154
|
if @workers[ruby_class].nil?
|
147
|
-
result = block.call(
|
155
|
+
result = block.call(processing_payload, metadata, delivery_info) unless block.nil?
|
148
156
|
else
|
149
|
-
result = @workers[ruby_class].process(
|
157
|
+
result = @workers[ruby_class].process(processing_payload, metadata, delivery_info)
|
150
158
|
end
|
151
159
|
else
|
152
|
-
::Istox::BunnyBoot.cacheMsg(Time.now.to_s, {queue: queue.name, payload: payload})
|
160
|
+
::Istox::BunnyBoot.cacheMsg(Time.now.to_s, {queue: queue.name, payload: payload}) if store
|
153
161
|
end
|
154
162
|
# active_channel.ack(delivery_info.delivery_tag) if manual_ack
|
155
163
|
rescue StandardError => e
|
@@ -163,9 +171,9 @@ module Istox
|
|
163
171
|
log.debug "Consumer Retry count: #{retry_count}"
|
164
172
|
# @option opts [Integer] :priority Message priority, 0 to 9. Not used by RabbitMQ, only applications
|
165
173
|
# here we adopt the unused priority as remaining retry_count
|
166
|
-
|
167
|
-
|
168
|
-
::Istox::BunnyBoot.publish(exchange_retry,
|
174
|
+
processing_payload = JSON.parse(payload)
|
175
|
+
processing_payload = ::Istox::CommonHelper.to_open_struct(processing_payload) if ::Istox::BunnyBoot.queue_worker_param_format(consumer_key) == 'open_struct'
|
176
|
+
::Istox::BunnyBoot.publish(exchange_retry, processing_payload, routing_key: "#{queue_name}.retry", priority: retry_count, type: 'dlx')
|
169
177
|
end
|
170
178
|
=begin
|
171
179
|
# For redelivered message, call 'reject' not 'nack' in order to reschedule message to tail not head of queue
|
data/lib/istox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: istox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.135
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Siong Leng
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|