eventq_rabbitmq 1.18.0 → 1.18.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b46c2fdb9dd907c5a923d1bab7a816017896e8e7
4
- data.tar.gz: 921e8ef146205bc884580936a5bb757600956fc7
3
+ metadata.gz: 5d2bb6547f6d4201f1874fb94225adbf9098445a
4
+ data.tar.gz: be299a1269ae2310faac7533a4e975b28c6581e1
5
5
  SHA512:
6
- metadata.gz: c5cdb23b764e56bb9615337befd0a7cbd3ee7718c873087470ececb252c1c5bd6ddfbcda067f184dd2435f6fffa443cf2e20208eb0e9e8cfeaf2980a8c570b42
7
- data.tar.gz: ea96de7b90757e49eb516853c913433a487506e456d110cd92f9493ea37589dcd24a80990ba5732c6eafe4c36053eb8c29ae3e6d513280c99f3a2b84ba15027e
6
+ metadata.gz: 4db1c3924ae4fbb984cb5535bb56d631dc097e2f803c766df1f7168b766025fc630f5483d0a19238e7cc55d22cc6238d6957a8fd8eca89ef35f6aca3c1a2b18c
7
+ data.tar.gz: 1d12c3fb36500cb3fdce0d2a6c4a373708cb6ce50ac8373a01b190b7b9feb8d7179e637a91cd64c10a2866c346654bf2b836777d049ac16d4a7ca51a34793e84
@@ -346,10 +346,14 @@ module EventQ
346
346
 
347
347
  @signature_provider_manager.validate_signature(message: message, queue: queue)
348
348
 
349
- message_args = EventQ::MessageArgs.new(type: message.type,
350
- retry_attempts: message.retry_attempts,
351
- context: message.context,
352
- content_type: message.content_type)
349
+ message_args = EventQ::MessageArgs.new(
350
+ type: message.type,
351
+ retry_attempts: message.retry_attempts,
352
+ context: message.context,
353
+ content_type: message.content_type,
354
+ id: message.id,
355
+ sent: message.created
356
+ )
353
357
 
354
358
  if(!EventQ::NonceManager.is_allowed?(message.id))
355
359
  EventQ.logger.info("[#{self.class}] - Duplicate Message received. Dropping message.")
@@ -6,7 +6,6 @@ module EventQ
6
6
  attr_accessor :is_running
7
7
 
8
8
  def initialize
9
- @threads = []
10
9
  @forks = []
11
10
  @is_running = false
12
11
 
@@ -16,8 +15,6 @@ module EventQ
16
15
  @hash_helper = HashKit::Helper.new
17
16
  @serialization_provider_manager = EventQ::SerializationProviders::Manager.new
18
17
  @signature_provider_manager = EventQ::SignatureProviders::Manager.new
19
- @last_gc_flush = Time.now
20
- @gc_flush_interval = 10
21
18
  end
22
19
 
23
20
  def start(queue, options = {}, &block)
@@ -68,33 +65,28 @@ module EventQ
68
65
  options[:durable] = true
69
66
  end
70
67
 
71
- client = options[:client]
68
+ client = options[:client].dup
72
69
  manager = EventQ::RabbitMq::QueueManager.new
73
70
  manager.durable = options[:durable]
74
71
  @connection = client.get_connection
75
72
 
76
- @threads = []
73
+ channel = @connection.create_channel
77
74
 
78
- # loop through each thread count
79
- @thread_count.times do
80
- channel = @connection.create_channel
75
+ q = manager.get_queue(channel, queue)
76
+ retry_exchange = manager.get_retry_exchange(channel, queue)
81
77
 
82
- q = manager.get_queue(channel, queue)
83
- retry_exchange = manager.get_retry_exchange(channel, queue)
84
-
85
- q.subscribe(:manual_ack => true, :consumer_tag => SecureRandom.uuid) do |delivery_info, properties, payload|
86
- begin
87
- tag_processing_thread
88
- process_message(payload, queue, channel, retry_exchange, delivery_info.delivery_tag, block)
89
- rescue => e
90
- EventQ.logger.error(
91
- "[#{self.class}] - An error occurred attempting to process a message. Error: #{e} | "\
78
+ q.subscribe(:manual_ack => true, :exclusive => false) do |delivery_info, properties, payload|
79
+ begin
80
+ tag_processing_thread
81
+ process_message(payload, queue, channel, retry_exchange, delivery_info.delivery_tag, block)
82
+ rescue => e
83
+ EventQ.logger.error(
84
+ "[#{self.class}] - An error occurred attempting to process a message. Error: #{e} | "\
92
85
  "Backtrace: #{e.backtrace}"
93
- )
94
- call_on_error_block(error: e)
95
- ensure
96
- untag_processing_thread
97
- end
86
+ )
87
+ call_on_error_block(error: e)
88
+ ensure
89
+ untag_processing_thread
98
90
  end
99
91
  end
100
92
 
@@ -234,10 +226,12 @@ module EventQ
234
226
  def configure(queue, options = {})
235
227
  @queue = queue
236
228
 
237
- # default thread count
238
- @thread_count = 1
239
229
  if options.key?(:thread_count)
240
- @thread_count = options[:thread_count]
230
+ EventQ.logger.warn("[#{self.class}] - :thread_count is deprecated.")
231
+ end
232
+
233
+ if options.key?(:sleep)
234
+ EventQ.logger.warn("[#{self.class}] - :sleep is deprecated.")
241
235
  end
242
236
 
243
237
  @fork_count = 1
@@ -246,8 +240,7 @@ module EventQ
246
240
  end
247
241
 
248
242
  EventQ.logger.info(
249
- "[#{self.class}] - Configuring. Process Count: #{@fork_count} | Thread Count: #{@thread_count} | "\
250
- "Interval Sleep: #{@sleep}."
243
+ "[#{self.class}] - Configuring. Process Count: #{@fork_count}."
251
244
  )
252
245
 
253
246
  return true
@@ -264,10 +257,14 @@ module EventQ
264
257
 
265
258
  @signature_provider_manager.validate_signature(message: message, queue: queue)
266
259
 
267
- message_args = EventQ::MessageArgs.new(type: message.type,
268
- retry_attempts: message.retry_attempts,
269
- context: message.context,
270
- content_type: message.content_type)
260
+ message_args = EventQ::MessageArgs.new(
261
+ type: message.type,
262
+ retry_attempts: message.retry_attempts,
263
+ context: message.context,
264
+ content_type: message.content_type,
265
+ id: message.id,
266
+ sent: message.created
267
+ )
271
268
 
272
269
  if(!EventQ::NonceManager.is_allowed?(message.id))
273
270
  EventQ.logger.info("[#{self.class}] - Duplicate Message received. Dropping message.")
@@ -1,3 +1,3 @@
1
1
  module EventqRabbitmq
2
- VERSION = "1.18.0"
2
+ VERSION = "1.18.1"
3
3
  end
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.18.0
4
+ version: 1.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - vaughanbrittonsage
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-30 00:00:00.000000000 Z
11
+ date: 2018-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.15'
61
+ version: '1.17'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.15'
68
+ version: '1.17'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bunny
71
71
  requirement: !ruby/object:Gem::Requirement