eventq_rabbitmq 1.8.2 → 1.9.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a05e68dadc2902ff186c61338c4b846d8f99e1e
|
4
|
+
data.tar.gz: 5d194cdf46a0b36473bbb737a35e672a73122303
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6df02b234f53398873ec480dc3f23205a02e9d23ebd99feb88f2928e942c90c29cc6cf26a11b807a1ad52f20abffa31a3bfa5773f93ae69217de0d5fc5e9ef1
|
7
|
+
data.tar.gz: be6b820e3add9890fd38f899aa7b86ef001ca8fafd5495038738479da2852f1f7e7747d8c9bb2a605a4ff1292e49c88913fbb31950fa5e96b74d3ceced761651
|
@@ -23,7 +23,7 @@ module EventQ
|
|
23
23
|
|
24
24
|
ex = @queue_manager.get_exchange(channel, @event_raised_exchange)
|
25
25
|
|
26
|
-
qm =
|
26
|
+
qm = new_message
|
27
27
|
qm.content = event
|
28
28
|
qm.type = event_type
|
29
29
|
|
@@ -47,6 +47,10 @@ module EventQ
|
|
47
47
|
return true
|
48
48
|
end
|
49
49
|
|
50
|
+
def new_message
|
51
|
+
EventQ::QueueMessage.new
|
52
|
+
end
|
53
|
+
|
50
54
|
end
|
51
55
|
end
|
52
56
|
end
|
@@ -13,6 +13,8 @@ module EventQ
|
|
13
13
|
@retry_exceeded_block = nil
|
14
14
|
@hash_helper = HashKit::Helper.new
|
15
15
|
@serialization_provider_manager = EventQ::SerializationProviders::Manager.new
|
16
|
+
@last_gc_flush = Time.now
|
17
|
+
@gc_flush_interval = 10
|
16
18
|
end
|
17
19
|
|
18
20
|
def start(queue, options = {}, &block)
|
@@ -99,7 +101,7 @@ module EventQ
|
|
99
101
|
channel.close
|
100
102
|
end
|
101
103
|
|
102
|
-
|
104
|
+
gc_flush
|
103
105
|
|
104
106
|
if !has_processed
|
105
107
|
EventQ.log(:debug, "[#{self.class}] - Sleeping for #{@sleep} seconds")
|
@@ -122,6 +124,17 @@ module EventQ
|
|
122
124
|
|
123
125
|
end
|
124
126
|
|
127
|
+
def gc_flush
|
128
|
+
if Time.now - last_gc_flush > @gc_flush_interval
|
129
|
+
GC.start
|
130
|
+
@last_gc_flush = Time.now
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
def last_gc_flush
|
135
|
+
@last_gc_flush
|
136
|
+
end
|
137
|
+
|
125
138
|
def thread_process_iteration(channel, manager, queue, block)
|
126
139
|
|
127
140
|
#get the queue
|
@@ -256,6 +269,11 @@ module EventQ
|
|
256
269
|
@fork_count = options[:fork_count]
|
257
270
|
end
|
258
271
|
|
272
|
+
@gc_flush_interval = 10
|
273
|
+
if options.key?(:gc_flush_interval)
|
274
|
+
@gc_flush_interval = options[:gc_flush_interval]
|
275
|
+
end
|
276
|
+
|
259
277
|
EventQ.log(:info, "[#{self.class}] - Configuring. Process Count: #{@fork_count} | Thread Count: #{@thread_count} | Interval Sleep: #{@sleep}.")
|
260
278
|
|
261
279
|
return true
|
@@ -266,12 +284,18 @@ module EventQ
|
|
266
284
|
|
267
285
|
def process_message(payload, queue, channel, retry_exchange, delivery_info, block)
|
268
286
|
abort = false
|
287
|
+
error = false
|
288
|
+
received = false
|
269
289
|
message = deserialize_message(payload)
|
270
290
|
|
271
291
|
EventQ.log(:debug, "[#{self.class}] - Message received. Retry Attempts: #{message.retry_attempts}")
|
272
292
|
|
273
293
|
message_args = EventQ::MessageArgs.new(message.type, message.retry_attempts)
|
274
294
|
|
295
|
+
if(!EventQ::NonceManager.is_allowed?(message.id))
|
296
|
+
return false
|
297
|
+
end
|
298
|
+
|
275
299
|
#begin worker block for queue message
|
276
300
|
begin
|
277
301
|
block.call(message.content, message_args)
|
@@ -292,7 +316,10 @@ module EventQ
|
|
292
316
|
end
|
293
317
|
|
294
318
|
if error || abort
|
319
|
+
EventQ::NonceManager.failed(message.id)
|
295
320
|
reject_message(channel, message, delivery_info, retry_exchange, queue)
|
321
|
+
else
|
322
|
+
EventQ::NonceManager.complete(message.id)
|
296
323
|
end
|
297
324
|
|
298
325
|
yield [received, error]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eventq_rabbitmq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vaughanbrittonsage
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -84,16 +84,16 @@ dependencies:
|
|
84
84
|
name: eventq_base
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: hash_kit
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|