istox 0.1.152.debug.3 → 0.1.152.debug.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/istox/helpers/publisher.rb +3 -36
- data/lib/istox/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0907cf089004ea6e884b60b6e2765733bec9cb922c3d714d6bdab0d55799a1d
|
4
|
+
data.tar.gz: 70e7bf9bfeef4e3e90fdd63ad156c02e6a028bdc589f3f47d013a46fba773b8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84afbbe94d4ee7bb101a2628597f18fd7bb65180bd3c0b2a7ed89210ece6a39813c2e2b7585e64da1af02e336527153f8ccf37be3ab5e339803d75f8840d8919
|
7
|
+
data.tar.gz: 0c2a3133497107c862de09e2f99bd497cda18c9b4b801c9abb5a9f9177db323fef88a9d218021ac36d3a2ebf4dca2968562b0d284149a5c68a194e6997a3963e
|
data/Gemfile.lock
CHANGED
@@ -59,8 +59,7 @@ module Istox
|
|
59
59
|
Thread.new do
|
60
60
|
loop do
|
61
61
|
Thread.new do
|
62
|
-
|
63
|
-
sleep 5
|
62
|
+
sleep 60 * 5
|
64
63
|
|
65
64
|
tid = []
|
66
65
|
Thread.list.each do |t|
|
@@ -112,39 +111,6 @@ module Istox
|
|
112
111
|
|
113
112
|
log.info "Current @channel object is: #{@channel}"
|
114
113
|
|
115
|
-
threadId = Thread.current.object_id
|
116
|
-
# Start new thread on receiving ACK from 'confirm-1' channel on the specified thread
|
117
|
-
Thread.new do
|
118
|
-
log.info("Create thread #{Thread.current.object_id} for monitoring confirm-1")
|
119
|
-
loop do
|
120
|
-
sleep 5
|
121
|
-
begin
|
122
|
-
success = @channel[threadId]['confirm-1'].wait_for_confirms
|
123
|
-
if success
|
124
|
-
::Istox::BunnyBoot.del_tracker_on_channel @channel[threadId]['confirm-1'].id
|
125
|
-
else
|
126
|
-
@channel[threadId]['confirm-1'].nacked_set.each do |n|
|
127
|
-
log.info("Publish Error[Async #{threadId}]: UNACK delivery tag is #{n}, republish message")
|
128
|
-
eid = ::Istox::BunnyBoot.find_tracker_on_channel @channel[threadId]['confirm-1'].id, n, 'eid'
|
129
|
-
payload = ::Istox::BunnyBoot.find_tracker_on_channel @channel[threadId]['confirm-1'].id, n, 'payload'
|
130
|
-
payload = JSON.parse(payload, :symbolize_names => true) unless payload.nil?
|
131
|
-
options = ::Istox::BunnyBoot.find_tracker_on_channel @channel[threadId]['confirm-1'].id, n, 'options'
|
132
|
-
options = JSON.parse(options, :symbolize_names => true) unless options.nil?
|
133
|
-
if options.nil?
|
134
|
-
routing_key = nil
|
135
|
-
else
|
136
|
-
routing_key = options.delete :routing_key
|
137
|
-
options[:delivery_tag] = n
|
138
|
-
end
|
139
|
-
publish(exchange: eid, routing_key: routing_key, message: payload, options: options)
|
140
|
-
end
|
141
|
-
end
|
142
|
-
rescue => e
|
143
|
-
# log.debug "wait_for_confirm error happening: #{e}"
|
144
|
-
end
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
114
|
@channel[Thread.current.object_id]
|
149
115
|
end
|
150
116
|
|
@@ -167,7 +133,8 @@ module Istox
|
|
167
133
|
|
168
134
|
def channel_from_mode(mode)
|
169
135
|
if mode == 0 || mode == 1
|
170
|
-
|
136
|
+
# Currently we use mode 0 only
|
137
|
+
channel["confirm-0"]
|
171
138
|
else
|
172
139
|
channel['noconfirm']
|
173
140
|
end
|
data/lib/istox/version.rb
CHANGED