pwwka 0.20.0 → 0.21.0

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
  SHA256:
3
- metadata.gz: f3112d40e1055cea1ee6a8d1335933a40d8bb8676eee3e59f8143c5bcc5ec945
4
- data.tar.gz: 3ff10bab3455edb15cbca6ae7d7ef67c2e9a6ad58fb678fa31a3b8cd74f9f648
3
+ metadata.gz: 03c194e74867672309005716e99ae625198af4d62cc786597d69f512271167ef
4
+ data.tar.gz: 7393fe11c6fba435026b0f2a9d9e151ef0d661dd39d8d68aa863d0a6b2a78e04
5
5
  SHA512:
6
- metadata.gz: 77c1ba64026ff171573ac521e0245dadf23aa7a9f76abafe1205f79af3753d78a59139bc7c93565a5f1bc86fbf5184e74d8dd54c665ba281e0329df37f980b91
7
- data.tar.gz: 65fe34a0aca0e31ed8210939268df9852c986a34d60d198ed785d43e6a49a7da7f57435bb7d37b4ecb456165301d3569667aa80f029441ab2950174cb90671c7
6
+ metadata.gz: 75e2869b0502198ac7ce178de20a0b219e7c7e3c11ccda626ae9ab0383c0fcfe1903ea3101cb23885100e823f08449a4743b46152d172bc0237bb8e4283dff13
7
+ data.tar.gz: 87b050ce2821f2569bf1b9eaad59d691ecd9b6ded09a9e3dedd88e55a54a4e8d39d82f34b7b536c3cce3f9028ae1568757b4aa121639d771b14206aeb594f14f
data/README.md CHANGED
@@ -38,6 +38,7 @@ Pwwka.configure do |config|
38
38
  config.options = {allow_delayed: true}
39
39
  config.requeue_on_error = true
40
40
  config.default_prefetch = 10
41
+ config.process_name = "my-process-name"
41
42
  end
42
43
  ```
43
44
 
@@ -13,6 +13,7 @@ module Pwwka
13
13
  attr_accessor :async_job_klass
14
14
  attr_accessor :send_message_resque_backoff_strategy
15
15
  attr_accessor :default_prefetch
16
+ attr_accessor :process_name
16
17
  attr_reader :requeue_on_error
17
18
  attr_writer :app_id
18
19
  attr_writer :error_handling_chain
@@ -32,6 +33,7 @@ module Pwwka
32
33
  @async_job_klass = Pwwka::SendMessageAsyncJob
33
34
  @default_prefetch = nil
34
35
  @receive_raw_payload = false
36
+ @process_name = $0
35
37
  end
36
38
 
37
39
  def keep_alive_on_handler_klass_exceptions?
@@ -12,7 +12,7 @@ module Pwwka
12
12
  def initialize(queue_name, routing_key, prefetch: Pwwka.configuration.default_prefetch)
13
13
  @queue_name = queue_name
14
14
  @routing_key = routing_key
15
- @channel_connector = ChannelConnector.new(prefetch: prefetch, connection_name: "c: #{queue_name}")
15
+ @channel_connector = ChannelConnector.new(prefetch: prefetch, connection_name: "c: #{Pwwka.configuration.app_id} #{Pwwka.configuration.process_name}".strip)
16
16
  @channel = @channel_connector.channel
17
17
  @topic_exchange = @channel_connector.topic_exchange
18
18
  end
@@ -26,7 +26,7 @@ module Pwwka
26
26
  attr_reader :channel_connector
27
27
 
28
28
  def initialize
29
- @channel_connector = ChannelConnector.new(connection_name: "p: #{Pwwka.configuration.app_id}")
29
+ @channel_connector = ChannelConnector.new(connection_name: "p: #{Pwwka.configuration.app_id} #{Pwwka.configuration.process_name}".strip)
30
30
  end
31
31
 
32
32
  # Send an important message that must go through. This method allows any raised exception
@@ -1,3 +1,4 @@
1
1
  module Pwwka
2
- VERSION = '0.20.0'
2
+ VERSION = '0.21.0'
3
3
  end
4
+
@@ -35,6 +35,7 @@ RSpec.configure do |config|
35
35
  c.requeue_on_error = false
36
36
  c.rabbit_mq_host = "amqp://guest:guest@localhost:#{test_configuration.rabbit_port}"
37
37
  c.app_id = "MyAwesomeApp"
38
+ c.process_name = "my_awesome_process"
38
39
 
39
40
  unless ENV["SHOW_PWWKA_LOG"] == "true"
40
41
  c.logger = MonoLogger.new("/dev/null")
@@ -26,7 +26,7 @@ describe Pwwka::Receiver do
26
26
 
27
27
  it 'sets the correct connection_name' do
28
28
  subject
29
- expect(Pwwka::ChannelConnector).to have_received(:new).with(prefetch: nil, connection_name: "c: #{queue_name}")
29
+ expect(Pwwka::ChannelConnector).to have_received(:new).with(prefetch: nil, connection_name: "c: MyAwesomeApp my_awesome_process")
30
30
  end
31
31
 
32
32
  it 'closes the conenction on an error' do
@@ -20,7 +20,7 @@ describe Pwwka::Transmitter do
20
20
  allow(logger).to receive(:info)
21
21
  allow(logger).to receive(:warn)
22
22
  allow(logger).to receive(:error)
23
- allow(Pwwka::ChannelConnector).to receive(:new).with(connection_name: "p: MyAwesomeApp").and_return(channel_connector)
23
+ allow(Pwwka::ChannelConnector).to receive(:new).with(connection_name: "p: MyAwesomeApp my_awesome_process").and_return(channel_connector)
24
24
  allow(channel_connector).to receive(:connection_close)
25
25
  allow(topic_exchange).to receive(:publish)
26
26
  allow(delayed_exchange).to receive(:publish)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwwka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.0
4
+ version: 0.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stitch Fix Engineering
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2018-12-20 00:00:00.000000000 Z
18
+ date: 2019-01-07 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: bunny