eventq 2.1.1 → 2.1.2

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: 50c59e4ec2bbc380df907fc8b085dd2d7d54957eea3a011e7f5b97158abaafe7
4
- data.tar.gz: 3af24846b748e58f424e420b89eafd38da1f182233db6ef9754024463d201961
3
+ metadata.gz: ba5bfee3e1fd027189bc32012b22e94f4d7bd81707ef3811d1748f9ee09a4887
4
+ data.tar.gz: 0f32197796b9c7b5bf5b7f57146bdd8ca992931fecadd594455e72cd2213ef93
5
5
  SHA512:
6
- metadata.gz: 8dc1863c3834f869b3add677ea798ddbb8ebb8467eaf54d632abefad93989785d264c95b0146b08eaf008038c9280c0206c97b29aaa0b07a35922ee229c8a4b7
7
- data.tar.gz: 8c2efc5e7da28333993eceef32c39a0b7238c1379e5e37be53dad4a1e826192e9a19917dd5c276710d093dfbda72573afb27aabae99f6887ab83d473891782c7
6
+ metadata.gz: b0133ee80992c77a7105a22a720bc8ca4d17da12849ed02b56b0640056646f3a30c401dfc4ab789b964a843b0e0cdfcdde765f225b936e1ac94e874e73fcd0a4
7
+ data.tar.gz: a4c024e13ff25f62fc6497af126871a9aa6de1d1369b11bed51dddcd87829d7950600f4fea8c9e030bf54bc0376427d8e40276fe2f0f8e8478f073d556a3acc6
@@ -9,7 +9,7 @@ module EventQ
9
9
 
10
10
  APPROXIMATE_RECEIVE_COUNT = 'ApproximateReceiveCount'
11
11
  MESSAGE = 'Message'
12
- AWS_MAX_VISIBILITY_TIMEOUT = 43_200 # 12h
12
+ AWS_MAX_VISIBILITY_TIMEOUT = 43_200 # 12h
13
13
 
14
14
  attr_accessor :context
15
15
 
@@ -96,27 +96,27 @@ module EventQ
96
96
  when :accepted
97
97
  # Acceptance was handled directly when QueueWorker#process_message was called
98
98
  when :reject
99
- reject_message(queue, poller, msg, retry_attempts, message, message_args.abort)
99
+ reject_message(queue, poller, msg, retry_attempts, message, message_args)
100
100
  else
101
101
  raise "Unrecognized status: #{status}"
102
102
  end
103
103
  end
104
104
 
105
- def reject_message(queue, poller, msg, retry_attempts, message, abort)
105
+ def reject_message(queue, poller, msg, retry_attempts, message, args)
106
106
  if !queue.allow_retry || retry_attempts >= queue.max_retry_attempts
107
- EventQ.logger.info("[#{self.class}] - Message rejected removing from queue. Message: #{serialize_message(message)}")
107
+ EventQ.logger.info("[#{self.class}] - Message Id: #{args.id}. Rejected removing from queue. Message: #{serialize_message(message)}")
108
108
 
109
109
  # remove the message from the queue so that it does not get retried again
110
110
  poller.delete_message(msg)
111
111
 
112
112
  if retry_attempts >= queue.max_retry_attempts
113
- EventQ.logger.info("[#{self.class}] - Message retry attempt limit exceeded.")
113
+ EventQ.logger.info("[#{self.class}] - Message Id: #{args.id}. Retry attempt limit exceeded.")
114
114
  context.call_on_retry_exceeded_block(message)
115
115
  end
116
116
  elsif queue.allow_retry
117
117
  retry_attempts += 1
118
118
 
119
- EventQ.logger.info("[#{self.class}] - Message rejected requesting retry. Attempts: #{retry_attempts}")
119
+ EventQ.logger.info("[#{self.class}] - Message Id: #{args.id}. Rejected requesting retry. Attempts: #{retry_attempts}")
120
120
 
121
121
  visibility_timeout = @calculate_visibility_timeout.call(
122
122
  retry_attempts: retry_attempts,
@@ -125,10 +125,10 @@ module EventQ
125
125
  sent: message.created
126
126
  )
127
127
 
128
- EventQ.logger.info("[#{self.class}] - Message received. Retry Attempts: #{retry_attempts}")
128
+ EventQ.logger.info("[#{self.class}] - Message received. Id: #{message.id}. Retry Attempts: #{retry_attempts}")
129
129
 
130
130
  if (!EventQ::NonceManager.is_allowed?(message.id))
131
- EventQ.logger.info("[#{self.class}] - Duplicate Message received. Ignoring message.")
131
+ EventQ.logger.info("[#{self.class}] - Duplicate Message received. Id: #{message.id}. Ignoring message.")
132
132
  status = :duplicate
133
133
  return status, message_args
134
134
  end
@@ -139,17 +139,17 @@ module EventQ
139
139
 
140
140
  if message_args.abort == true
141
141
  abort = true
142
- EventQ.logger.info("[#{self.class}] - Message aborted.")
142
+ EventQ.logger.info("[#{self.class}] - Message aborted. Id: #{message.id}.")
143
143
  else
144
144
  # accept the message as processed
145
145
  status = :accepted
146
146
  worker_adapter.acknowledge_message(*acceptance_args)
147
- EventQ.logger.info("[#{self.class}] - Message acknowledged.")
147
+ EventQ.logger.info("[#{self.class}] - Message acknowledged. Id: #{message.id}.")
148
148
  end
149
149
  rescue => e
150
150
  EventQ.logger.error do
151
- "[#{self.class}] - Unhandled error while attempting to process a queue message. - #{e.message}" \
152
- "#{e.backtrace.join("\n")}"
151
+ "[#{self.class}] - Unhandled error while attempting to process a queue message. Id: #{message.id}. " \
152
+ "Error: #{e.message} #{e.backtrace.join("\n")}"
153
153
  end
154
154
 
155
155
  error = true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eventq
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - SageOne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-03 00:00:00.000000000 Z
11
+ date: 2018-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler