istox 0.1.135 → 0.1.136

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea4ecfc5feab0cbc06336dadb22e0b4070951a0fe4f56293ffa0d1c2ddfe2e41
4
- data.tar.gz: 40d4295b9dd6e08e094518681f568c893149031e6632357b9dda239975fdcf56
3
+ metadata.gz: 9ba46f77cb39ba25e26e78b1e1e614bc42ea8669a94f1b4a40e13fd7a392abed
4
+ data.tar.gz: 97a410fedb5e49e39fd460db6bed6b07af60b9a57b9c12a3ab59580bcf8f3a3b
5
5
  SHA512:
6
- metadata.gz: ee86396ae458514e4b432e10b60cce8a2a5d800de2f685e7588338b7d0e63d2add4735566cf2276c147d69f7a0f79f443528e03461d30d3f73128aca255a4d88
7
- data.tar.gz: e2f8ca172f526606ce70243a3b93eda0ce33f6a2e3746acd92f7e5300dc4529e9bb6da4dcf46a8661b89c014e1a748438ec579393d341136e1119c18de4f4eec
6
+ metadata.gz: 7b7e125e07dcb9d8ba066ce5db0799894f79c4f1fd15cec3fba54b2807b2a5b64006ee03ad62e72f9c349d0e69ddb8a194ab451d5f00f0e77bed05cdfbd15918
7
+ data.tar.gz: f16800de052e97d3faa0580901f41ee9de6855a162be3bbb8aeb77ebb3452266e3028b0990368c1c79182e9a6be1a3850cde2d5976892d16653db133a289ad2a
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- istox (0.1.134)
4
+ istox (0.1.136)
5
5
  awesome_print
6
6
  binding_of_caller
7
7
  bunny (>= 2.12.0)
@@ -97,7 +97,7 @@ GEM
97
97
  ffi (1.12.2)
98
98
  globalid (0.4.2)
99
99
  activesupport (>= 4.2.0)
100
- google-protobuf (3.11.4)
100
+ google-protobuf (3.11.4-universal-darwin)
101
101
  googleapis-common-protos-types (1.0.4)
102
102
  google-protobuf (~> 3.0)
103
103
  graphlient (0.3.7)
@@ -108,7 +108,7 @@ GEM
108
108
  graphql-client (0.16.0)
109
109
  activesupport (>= 3.0)
110
110
  graphql (~> 1.8)
111
- grpc (1.27.0)
111
+ grpc (1.27.0-universal-darwin)
112
112
  google-protobuf (~> 3.11)
113
113
  googleapis-common-protos-types (~> 1.0)
114
114
  grpc-tools (1.27.0)
@@ -131,10 +131,6 @@ module Istox
131
131
  arguments = {}
132
132
  arguments['x-max-priority'] = priority unless priority.nil?
133
133
  queue.subscribe manual_ack: manual_ack, arguments: arguments do |delivery_info, metadata, payload|
134
- log.debug "Delivery_info: #{delivery_info}"
135
- log.debug "Metadata: #{metadata}"
136
- log.debug "Payload: #{payload}"
137
-
138
134
  # For retried message, if reaching retry count limit, return ack anyway
139
135
  # If retry limit is -1, no retry limit
140
136
  # TODO: No matter the amount of retry limit, send cloudwatch critical alarm if fails after 3 times of retry
@@ -142,11 +138,16 @@ module Istox
142
138
  process = true
143
139
  store = true
144
140
  process = false if metadata[:priority] && retry_limit != -1 && metadata[:priority] >= retry_limit
145
- if delivery_info[:routing_key] != queue_name
141
+ if delivery_info[:routing_key] && !delivery_info[:routing_key].empty? && delivery_info[:routing_key] != queue_name
146
142
  log.debug "Get retry message from other queue #{delivery_info[:routing_key]}, just ignore!!"
147
143
  process = false
148
144
  store = false
149
145
  end
146
+
147
+ log.debug "Delivery_info: #{delivery_info}"
148
+ log.debug "Metadata: #{metadata}"
149
+ log.debug "Payload: #{payload}"
150
+
150
151
  if process
151
152
  processing_payload = JSON.parse(payload)
152
153
  processing_payload = ::Istox::CommonHelper.to_open_struct(processing_payload) if ::Istox::BunnyBoot.queue_worker_param_format(consumer_key) == 'open_struct'
@@ -171,9 +172,11 @@ module Istox
171
172
  log.debug "Consumer Retry count: #{retry_count}"
172
173
  # @option opts [Integer] :priority Message priority, 0 to 9. Not used by RabbitMQ, only applications
173
174
  # here we adopt the unused priority as remaining retry_count
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')
175
+ if process
176
+ processing_payload = JSON.parse(payload)
177
+ processing_payload = ::Istox::CommonHelper.to_open_struct(processing_payload) if ::Istox::BunnyBoot.queue_worker_param_format(consumer_key) == 'open_struct'
178
+ ::Istox::BunnyBoot.publish(exchange_retry, processing_payload, routing_key: "#{queue_name}.retry", priority: retry_count, type: 'dlx')
179
+ end
177
180
  end
178
181
  =begin
179
182
  # For redelivered message, call 'reject' not 'nack' in order to reschedule message to tail not head of queue
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = '0.1.135'.freeze
2
+ VERSION = '0.1.136'.freeze
3
3
  end
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.135
4
+ version: 0.1.136
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-04-01 00:00:00.000000000 Z
11
+ date: 2020-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print