acception-subscriber 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/acception/subscriber/message_handler.rb +11 -19
- data/lib/acception/subscriber/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14904cb441d5daa072b9f0a5991f8cf963b34105
|
4
|
+
data.tar.gz: 0ae2c7fa32dba98a3b767108ccc86fae0d982f22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1ecf3085b33dba8655e05c0dd9f759e554e74314a8de8b45037611daa73d4ae00557a67e0aa6eb3584262be0637612e32d441b98a3ca80093933ea538ce6ff1
|
7
|
+
data.tar.gz: f09ef0ad246690379d40def23bba5ea20814714459e0c2d11773f436df8e46da938beb77a1ce1feeca5ef8fd9bf83e851db9a214f66c5ad4b58151cb6ba5c10b
|
@@ -31,11 +31,11 @@ module Acception
|
|
31
31
|
else
|
32
32
|
end
|
33
33
|
|
34
|
-
channel.acknowledge delivery_info.delivery_tag
|
34
|
+
channel.acknowledge( delivery_info.delivery_tag )
|
35
35
|
rescue => e
|
36
|
-
debug ANSI.red { "
|
37
|
-
debug ANSI.red { "
|
38
|
-
|
36
|
+
debug ANSI.red { "ERROR" } + " #{e.message}"
|
37
|
+
debug ANSI.red { "ERROR" } + " #{e.backtrace}"
|
38
|
+
channel.nack delivery_info.delivery_tag
|
39
39
|
end
|
40
40
|
|
41
41
|
protected
|
@@ -52,6 +52,7 @@ module Acception
|
|
52
52
|
session: (headers['session'] || BLANK),
|
53
53
|
type: (exception['class'] || BLANK),
|
54
54
|
stack: (exception['backtrace'] || BLANK) )
|
55
|
+
# TODO handle failure as well as success
|
55
56
|
acception.call
|
56
57
|
end
|
57
58
|
|
@@ -65,6 +66,11 @@ module Acception
|
|
65
66
|
content: (headers['type'] || BLANK),
|
66
67
|
content_type: 'text/plain'
|
67
68
|
},
|
69
|
+
{
|
70
|
+
name: 'exceeded_days',
|
71
|
+
content: (headers['exceeded_days'] || BLANK),
|
72
|
+
content_type: 'text/plain'
|
73
|
+
},
|
68
74
|
{
|
69
75
|
name: 'license-content',
|
70
76
|
content: (headers['content'] || BLANK),
|
@@ -86,6 +92,7 @@ module Acception
|
|
86
92
|
content_type: 'application/base64'
|
87
93
|
}
|
88
94
|
])
|
95
|
+
# TODO handle failure as well as success
|
89
96
|
acception.call
|
90
97
|
end
|
91
98
|
|
@@ -95,21 +102,6 @@ module Acception
|
|
95
102
|
return nil
|
96
103
|
end
|
97
104
|
|
98
|
-
#def handle_error( channel, payload, e )
|
99
|
-
#error( ANSI.red { e.message + " | " + e.backtrace.inspect } )
|
100
|
-
#error_queue( channel ).publish( payload, headers: { application: Acception::Subscriber::APP_ID,
|
101
|
-
#exception_message: e.message,
|
102
|
-
#exception_class: e.class.name,
|
103
|
-
#exception_backtrace: e.backtrace } )
|
104
|
-
#rescue => ex
|
105
|
-
#error( ANSI.red { ex.message + " | " + ex.backtrace.inspect } )
|
106
|
-
#end
|
107
|
-
|
108
|
-
#def requeue( channel, delivery_info, e=nil )
|
109
|
-
#debug ANSI.yellow { 'REQUEUE ' + e.message }
|
110
|
-
#channel.reject delivery_info.delivery_tag, REQUEUE
|
111
|
-
#end
|
112
|
-
|
113
105
|
def config
|
114
106
|
Acception::Subscriber.configuration
|
115
107
|
end
|