eventhub-processor 0.6.2 → 0.6.3

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
  SHA1:
3
- metadata.gz: 4946cad4a004ffef0d9bf410f37a77ce3d22f41e
4
- data.tar.gz: 34c903d3ece4d4da7851036895bf7c897699c4a7
3
+ metadata.gz: 75b52567e9b5001d79b65023c1a8d73d6bc4d1c1
4
+ data.tar.gz: ded2679308c66b9379c8ee5120a803ca1cc04577
5
5
  SHA512:
6
- metadata.gz: 6b115aac28f95eb90d7d0526643b7fe1fa36db907a0894f5ffdaffa53d47b683ff3623e75662ddc61a10b001db16026d0c990c271a21917e4c1132b1735ce262
7
- data.tar.gz: 80caf4f744a45a74e86581bdd82027a7dd42ac58e75937c5b00d96fa59c50902722a72530720ce060efb7efb55b1311b70f1a02720e64b0255ca9eb954a329da
6
+ metadata.gz: 7a4a3c7165129bf28972fded59519f79504e68f0d271dafb16a0ff522958ce86ff0b245d7ee477c20c4ca6abae4b4fe8f3f8436f933ae3e984e1453b095d282e
7
+ data.tar.gz: 2d4e58f4c93fb3ee1730c187840c101df0991d011f0954067c23a7cd7c45fa02cad593b8fd0717c58daca6b707aa55e231abbd17bd3a7bafaf7a989f61ccadf0
@@ -1,18 +1,24 @@
1
1
  module EventHub
2
2
 
3
- EH_X_INBOUND = 'event_hub.inbound'
3
+ EH_X_INBOUND = 'event_hub.inbound'
4
4
 
5
- STATUS_INITIAL = 0 # To be set when dispatcher needs to dispatch to first process step.
6
- STATUS_SUCCESS = 200 # To be set to indicate successful processed message. Dispatcher will routes message to the next step.
7
- STATUS_RETRY = 300 # To be set to trigger retry cycle controlled by the dispatcher
8
- STATUS_RETRY_PENDING = 301 # Set and used by the dispatcher only.
9
- # Set before putting the message into a retry queue.
10
- # Once message has been retried it will sent do the same step with status.code = STATUS_SUCCESS
11
- STATUS_INVALID = 400 # To be set to indicate invalid message (not json, invalid Event Hub Message).
12
- # Dispatcher will publish message to the invalid queue.
13
- STATUS_DEADLETTER = 500 # To be set by dispatcher, processor or channel adapters to indicate
14
- # that message needs to be dead-lettered. Rejected messages could miss the
15
- # status.code = STATUS_DEADLETTER due to the RabbitMQ deadletter exchange mechanism.
16
- STATUS_SCHEDULE = 600 # To be set to trigger scheduler based on schedule block
17
- STATUS_SCHEDULE_PENDING = 601 # Set and used by the dispatcher only
5
+ STATUS_INITIAL = 0 # To be set when dispatcher needs to dispatch to first process step.
6
+
7
+ STATUS_SUCCESS = 200 # To be set to indicate successful processed message. Dispatcher will routes message to the next step.
8
+
9
+ STATUS_RETRY = 300 # To be set to trigger retry cycle controlled by the dispatcher
10
+ STATUS_RETRY_PENDING = 301 # Set and used by the dispatcher only.
11
+ # Set before putting the message into a retry queue.
12
+ # Once message has been retried it will sent do the same step with status.code = STATUS_SUCCESS
13
+
14
+ STATUS_INVALID = 400 # To be set to indicate invalid message (not json, invalid Event Hub Message).
15
+ # Dispatcher will publish message to the invalid queue.
16
+
17
+ STATUS_DEADLETTER = 500 # To be set by dispatcher, processor or channel adapters to indicate
18
+ # that message needs to be dead-lettered. Rejected messages could miss the
19
+ # status.code = STATUS_DEADLETTER due to the RabbitMQ deadletter exchange mechanism.
20
+
21
+ STATUS_SCHEDULE = 600 # To be set to trigger scheduler based on schedule block, proceses next process step
22
+ STATUS_SCHEDULE_RETRY = 601 # To be set to trigger scheduler based on schedule block, retry actual process step
23
+ STATUS_SCHEDULE_PENDING = 602 # Set and used by the dispatcher only
18
24
  end
@@ -93,10 +93,14 @@ module EventHub
93
93
  self.status_code == STATUS_INVALID
94
94
  end
95
95
 
96
- def scheduled?
96
+ def schedule?
97
97
  self.status_code == STATUS_SCHEDULE
98
98
  end
99
99
 
100
+ def schedule_retry?
101
+ self.status_code == STATUS_SCHEDULE_RETRY
102
+ end
103
+
100
104
  def schedule_pending?
101
105
  self.status_code == STATUS_SCHEDULE_PENDING
102
106
  end
@@ -132,14 +136,15 @@ module EventHub
132
136
 
133
137
  def self.translate_status_code(code)
134
138
  case code
135
- when EventHub::STATUS_INITIAL then return 'STATUS_INITIAL'
136
- when EventHub::STATUS_SUCCESS then return 'STATUS_SUCCESS'
137
- when EventHub::STATUS_RETRY then return 'STATUS_RETRY'
138
- when EventHub::STATUS_RETRY_PENDING then return 'STATUS_RETRY_PENDING'
139
- when EventHub::STATUS_INVALID then return 'STATUS_INVALID'
140
- when EventHub::STATUS_DEADLETTER then return 'STATUS_DEADLETTER'
141
- when EventHub::STATUS_SCHEDULE then return 'STATUS_SCHEDULE'
142
- when EventHub::STATUS_SCHEDULE_PENDING then return 'STATUS_SCHEDULE_PENDING'
139
+ when EventHub::STATUS_INITIAL then return 'STATUS_INITIAL'
140
+ when EventHub::STATUS_SUCCESS then return 'STATUS_SUCCESS'
141
+ when EventHub::STATUS_RETRY then return 'STATUS_RETRY'
142
+ when EventHub::STATUS_RETRY_PENDING then return 'STATUS_RETRY_PENDING'
143
+ when EventHub::STATUS_INVALID then return 'STATUS_INVALID'
144
+ when EventHub::STATUS_DEADLETTER then return 'STATUS_DEADLETTER'
145
+ when EventHub::STATUS_SCHEDULE then return 'STATUS_SCHEDULE'
146
+ when EventHub::STATUS_SCHEDULE_RETRY then return 'STATUS_SCHEDULE_RETRY'
147
+ when EventHub::STATUS_SCHEDULE_PENDING then return 'STATUS_SCHEDULE_PENDING'
143
148
  end
144
149
  end
145
150
 
@@ -1,3 +1,3 @@
1
1
  module EventHub
2
- VERSION = '0.6.2'
2
+ VERSION = '0.6.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eventhub-processor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Steiner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-08 00:00:00.000000000 Z
11
+ date: 2016-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler