banter 1.3.0 → 1.3.2

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: 20ba1b2e3b2fc1f89b3d25af6d5087e894ce4f87
4
- data.tar.gz: bab54a9008cf00eb37f8c682a5c32ea199017f0c
3
+ metadata.gz: 80b25572909dce4687781d01504ef62769092c27
4
+ data.tar.gz: 624e2969816519a17dd03a09b2a972261b38b2d8
5
5
  SHA512:
6
- metadata.gz: 1219d927b814c1ac6fdc88937d03082b757457c1a68bc454184d8adfb4c9c245b214d4faf886992a5a6fefd98dc1abcb7a7dc1613ca2344dcf0f3c1150119574
7
- data.tar.gz: 7a303f0e8e01d9891811e8ad06dba142d0dcc4074c8e6c880627d0d313a0956f6122e2d4379433fc2b92532d9f7192388cbf2b52c548938c03dba8e14bc1e088
6
+ metadata.gz: 53058a6a8953dfe2e937e38ce5e866af1cb0813076296707840cab4a3dc32d7923f78aae6f99dc362b76e94709ea649947249df9864d16b5927333e887873a5f
7
+ data.tar.gz: 15bf4626708359c18557a104cd9b7d627ca0d475698b7561dd3796f9fe1c5497fb6f538fec52fe25e173e1c426a3d498446a802aad5cadf5c1bcf00792ccacd6
@@ -52,6 +52,10 @@ module Banter
52
52
  mattr_accessor :application_name
53
53
  @@application_name = nil
54
54
 
55
+ # default pool size for the subscribers
56
+ mattr_accessor :pool_size
57
+ @@pool_size = 100
58
+
55
59
  def self.configure_with(environment_name, yaml_file = nil)
56
60
  @@yaml_file = yaml_file.nil? ? "config/banter.yml" : yaml_file
57
61
  @@all_conf = Hashie::Mash.new(YAML.load_file(@@yaml_file) )
@@ -36,8 +36,8 @@ module Banter
36
36
  end
37
37
 
38
38
  def self.log(log_level, message)
39
- tags = ["BANTER LOG_LEVEL:#{@@log_map[log_level].capitalize.to_s}", Process::pid]
40
- logger.tagged(tags) { logger.send(@@log_map[log_level], message.as_json ) }
39
+ tags = ["BANTER LOG_LEVEL:#{@@log_map[log_level].capitalize.to_s}", Process::pid.to_s].map{|x| utf(x)}
40
+ logger.tagged(tags) { logger.send(@@log_map[log_level], utf(message.as_json.to_s) ) }
41
41
  end
42
42
 
43
43
  def self.internal_log(log_level, log_type, envelope, routing_key, payload)
@@ -10,10 +10,13 @@ module Banter
10
10
  app.config.middleware.use Banter::Middleware
11
11
  end
12
12
 
13
+ config.before_configuration do
14
+ Banter::Configuration.application_name = Rails.application.class.name.to_s.gsub("::Application", '').downcase
15
+ end
16
+
13
17
  config.after_initialize do
14
18
  Banter.logger = config.banter.logger if config.banter.logger
15
19
 
16
- Banter::Configuration.application_name = Rails.application.class.name.to_s.gsub("::Application", '').downcase
17
20
  if Banter::Configuration.web_enabled
18
21
  require 'banter/web'
19
22
  end
@@ -10,6 +10,7 @@ module Banter
10
10
  attr_reader :ttl
11
11
  attr_reader :routing_key
12
12
  attr_reader :topic
13
+ attr_reader :pool_size
13
14
 
14
15
  def initialize(config)
15
16
  @topic = config.topic
@@ -19,7 +20,7 @@ module Banter
19
20
  @queue_name = config.queue_name
20
21
  @ttl = config.ttl
21
22
  @durable = config.durable
22
- @pool_size = config.pool_size
23
+ @pool_size = config.pool_size || 0
23
24
  if @topic.blank?
24
25
  @routing_key = "#"
25
26
  elsif @initial_key.present?
@@ -1,3 +1,3 @@
1
1
  module Banter
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.2"
3
3
  end
@@ -133,5 +133,24 @@ describe Banter::Server::RabbitMQSubscriber do
133
133
 
134
134
  end
135
135
 
136
+ describe "#initialize" do
137
+ context "when pool size is missing" do
138
+ let(:subscriber_config) { Hashie::Mash.new(
139
+ topic: "banter",
140
+ exchange: "banter",
141
+ dead_letter_exchange: "banter-dlx",
142
+ routing_key: routing_key,
143
+ queue_name: "test_queue",
144
+ ttl: 100,
145
+ durable: true
146
+ )}
147
+
148
+ it "should not call basic_qos" do
149
+ expect(subscriber.pool_size).to eq(0)
150
+ end
151
+
152
+ end
153
+
154
+ end
136
155
 
137
156
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: banter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Honest Company
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-10-20 00:00:00.000000000 Z
14
+ date: 2014-10-28 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler