bmc-daemon-lib 0.5.0 → 0.5.1
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/bmc-daemon-lib.gemspec +1 -1
- data/lib/bmc-daemon-lib/mq_consumer.rb +13 -5
- 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: 9d60ad0e1a7fef22c3f0e864e2bb3f22f6ba598a
|
4
|
+
data.tar.gz: 48d07a96593b70a1693d52cde23f990f72f5d9a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f3383b01b91dadd6a6a83f2951b308ecf0a24ec419e5904b97ab9e9ca302cbbb7eab90a3602640a76b03e6defab9e22464758817471b9e06bba06df0ead4234
|
7
|
+
data.tar.gz: e797000c902b243c932eed29bc74ba3ffb5fe2b45838f46e71b9b724cd477353becb86fbacd4b1f6696b4909fd648dbf536234535ca8c065ff982aa41dbb5970
|
data/Gemfile.lock
CHANGED
data/bmc-daemon-lib.gemspec
CHANGED
@@ -3,6 +3,7 @@ require 'time'
|
|
3
3
|
module BmcDaemonLib
|
4
4
|
class MqConsumerError < StandardError; end
|
5
5
|
class MqConsumerException < StandardError; end
|
6
|
+
class MqConsumerTopicNotFound < StandardError; end
|
6
7
|
|
7
8
|
class MqConsumer < MqEndpoint
|
8
9
|
include LoggerHelper
|
@@ -20,13 +21,20 @@ module BmcDaemonLib
|
|
20
21
|
end
|
21
22
|
|
22
23
|
def listen_to topic, rkey
|
23
|
-
#
|
24
|
-
exchange = @channel.topic(topic, durable: true, persistent: false)
|
25
|
-
|
24
|
+
# puts "listen_to(#{topic},#{rkey})"
|
26
25
|
log_info "listen_to [#{topic}] [#{rkey}] > [#{@queue.name}]"
|
27
|
-
@queue.bind
|
28
|
-
end
|
26
|
+
@queue.bind topic, routing_key: rkey
|
29
27
|
|
28
|
+
# Handle errors
|
29
|
+
rescue Bunny::NotFound => e
|
30
|
+
log_error "exchange not found: #{e.inspect}"
|
31
|
+
raise MqConsumerTopicNotFound, e.message
|
32
|
+
|
33
|
+
rescue StandardError => e
|
34
|
+
log_error "UNEXPECTED EXCEPTION: #{e.inspect}"
|
35
|
+
raise MqConsumerException, e.message
|
36
|
+
end
|
37
|
+
|
30
38
|
protected
|
31
39
|
|
32
40
|
def handle_receive context, delivery_info, metadata, payload
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bmc-daemon-lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno MEDICI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|