eventhub-processor 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eventhub/constant.rb +20 -14
- data/lib/eventhub/message.rb +14 -9
- data/lib/eventhub/version.rb +1 -1
- 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: 75b52567e9b5001d79b65023c1a8d73d6bc4d1c1
|
4
|
+
data.tar.gz: ded2679308c66b9379c8ee5120a803ca1cc04577
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a4a3c7165129bf28972fded59519f79504e68f0d271dafb16a0ff522958ce86ff0b245d7ee477c20c4ca6abae4b4fe8f3f8436f933ae3e984e1453b095d282e
|
7
|
+
data.tar.gz: 2d4e58f4c93fb3ee1730c187840c101df0991d011f0954067c23a7cd7c45fa02cad593b8fd0717c58daca6b707aa55e231abbd17bd3a7bafaf7a989f61ccadf0
|
data/lib/eventhub/constant.rb
CHANGED
@@ -1,18 +1,24 @@
|
|
1
1
|
module EventHub
|
2
2
|
|
3
|
-
EH_X_INBOUND
|
3
|
+
EH_X_INBOUND = 'event_hub.inbound'
|
4
4
|
|
5
|
-
STATUS_INITIAL
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
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
|
data/lib/eventhub/message.rb
CHANGED
@@ -93,10 +93,14 @@ module EventHub
|
|
93
93
|
self.status_code == STATUS_INVALID
|
94
94
|
end
|
95
95
|
|
96
|
-
def
|
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
|
136
|
-
when EventHub::STATUS_SUCCESS
|
137
|
-
when EventHub::STATUS_RETRY
|
138
|
-
when EventHub::STATUS_RETRY_PENDING
|
139
|
-
when EventHub::STATUS_INVALID
|
140
|
-
when EventHub::STATUS_DEADLETTER
|
141
|
-
when EventHub::STATUS_SCHEDULE
|
142
|
-
when EventHub::
|
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
|
|
data/lib/eventhub/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|