bbk-amqp 1.0.0.79546 → 1.0.0.82255

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: ff8bcca2839ed6b799122ae45b7815d91d6241ab3f42b3645ec17e5bbabb0320
4
- data.tar.gz: 735a3c4c4718de1def889bf9e701fcf847ffc9dfb406a14ccc705d64e9290763
3
+ metadata.gz: d96acd31582f6d08bb3ead76fa6cef86927cc2f6788bcc6f9bb4dd172d4734a6
4
+ data.tar.gz: 6deb1160d3c82a8007c10853880b59b0f3c785743b431388cefedb0a2865bd6d
5
5
  SHA512:
6
- metadata.gz: 61c04f60792a0bcfcb28a0d2ca0e09a2eb3c46e7271bb73eb089d262397416c76d73ea2859b6e7e19f2450af82c17eed513f5bb40441141c694bf076afb48b4c
7
- data.tar.gz: 9e7de36978f68bfdbe127059c4c9e7c1fe21a95a6c855c9b9e540ebc3561b933eea41d2ae66b262cec08cdcb5edeeb8437cea56f6884f22b25f5e1fb62fc9568
6
+ metadata.gz: 3f6c7740a23bff9fd1ea7d4305eeae509ecece8383851bf79b9e8f1314e67bfe8041b411e51d535195c15311b7b4e9e24cceabbf57c11a6a744f635373abccc1
7
+ data.tar.gz: 18c8815fb960e9eae38f9b9cc99e099e27adad437476feb5555bcf55e5755a210e77454b34cb692119fecc7f2240af2427217bbbaa71876a651882a7e9641886
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bbk-amqp (1.0.0.79546)
4
+ bbk-amqp (1.0.0.82255)
5
5
  activesupport (~> 6.0)
6
6
  bbk-utils (> 1.0.1)
7
7
  bunny (>= 2.19.0)
@@ -56,7 +56,8 @@ module BBK
56
56
  subscribe_opts = {
57
57
  block: false,
58
58
  manual_ack: true,
59
- consumer_tag: options[:consumer_tag]
59
+ consumer_tag: options[:consumer_tag],
60
+ exclusive: options.fetch(:exclusive, false)
60
61
  }.compact
61
62
 
62
63
  logger.info 'Starting...'
@@ -8,7 +8,7 @@ module BBK
8
8
  # Publisher send amqp messages
9
9
  class Publisher
10
10
 
11
- HEADER_PROP_FIELDS = %i[user_id message_id reply_to correlation_id].freeze
11
+ HEADER_PROP_FIELDS = %i[message_id reply_to correlation_id].freeze
12
12
  PROTOCOLS = %w[mq amqp amqps].freeze
13
13
 
14
14
  attr_reader :connection, :domains, :logger, :channel, :ack_map, :sended_messages, :channel
@@ -72,9 +72,14 @@ module BBK
72
72
  mandatory: true,
73
73
  routing_key: routing_key,
74
74
  headers: message.headers,
75
- user_id: client_name, # если есть в headers, то на следующей строке будет перетерто
75
+ # user_id: client_name,
76
76
  **message.headers.select {|k| HEADER_PROP_FIELDS.include? k }.compact
77
77
  }.merge(options).symbolize_keys
78
+ properties[:user_id] = if (user_id = message.headers[:user_id]).present?
79
+ user_id
80
+ else
81
+ client_name
82
+ end
78
83
  send_message(exchange, routing_key, message.payload, properties)
79
84
  end
80
85
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bbk-amqp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.79546
4
+ version: 1.0.0.82255
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samoylenko Yuri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-17 00:00:00.000000000 Z
11
+ date: 2022-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport