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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16ae424ba8d0838d48068487ec6739acda76b75d
4
- data.tar.gz: fc5235c44fc15208b7305d3872400ba3cee78cca
3
+ metadata.gz: 9d60ad0e1a7fef22c3f0e864e2bb3f22f6ba598a
4
+ data.tar.gz: 48d07a96593b70a1693d52cde23f990f72f5d9a7
5
5
  SHA512:
6
- metadata.gz: b450c78b14f81ace23d7a06f51d62dd5b1715ab2b4d9c30777d2bac02bcaeb32a53dbe9852a2570d44bd3febd9582f6b5dae94e97c36ad3ed21a73eecdaebe92
7
- data.tar.gz: f312782905efbecfd11c7403397913f80d0f2f38ce89ce28904d483c8b896c9c183c712e8b185d3814309315d29ba74ffb7152db3b3df922e58843e063268452
6
+ metadata.gz: 0f3383b01b91dadd6a6a83f2951b308ecf0a24ec419e5904b97ab9e9ca302cbbb7eab90a3602640a76b03e6defab9e22464758817471b9e06bba06df0ead4234
7
+ data.tar.gz: e797000c902b243c932eed29bc74ba3ffb5fe2b45838f46e71b9b724cd477353becb86fbacd4b1f6696b4909fd648dbf536234535ca8c065ff982aa41dbb5970
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bmc-daemon-lib (0.5.0)
4
+ bmc-daemon-lib (0.5.1)
5
5
  chamber (~> 2.9.1)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  Gem::Specification.new do |spec|
3
3
  # Project version
4
- spec.version = "0.5.0"
4
+ spec.version = "0.5.1"
5
5
 
6
6
  # Project description
7
7
  spec.name = "bmc-daemon-lib"
@@ -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
- # Exchange to this rule
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 exchange, routing_key: rkey
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.0
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-10-25 00:00:00.000000000 Z
11
+ date: 2016-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler