bbk-amqp 1.0.0.81661 → 1.0.0.82260

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: 7383eceef602da4c6dfb5c6bfa31b161f7f97fc75391f0215b769a2807e644ef
4
- data.tar.gz: 56b88eba1ac97a16183d1e9471462adfa2d99c38a24678b9fafde8ebec4aaa0e
3
+ metadata.gz: 2f79016d5cab4da9644abbb93ad71897c24a93a473bd21cf223ea3fd6eebaa7d
4
+ data.tar.gz: bcbcf9d71e111c5b6a8c9efe48ead69a46d0804890b6601be32571a57ee926d3
5
5
  SHA512:
6
- metadata.gz: 6ce4f910058005cb9ca048810370cf9447bae4fe176bcd0fcaa4cdff35271aa55c3b94abe11e6a28d3c16f825f414d10c93f8d1d99157554070d5b70d887e5e8
7
- data.tar.gz: bfc30528d0873325b5b860f7d18a206b5cd52a05edb2df83f7c3a4d6b95625a4fd1367a7af0ef5f8ebf07827be9464388dc6d4121d0e62ae62928e87976c81ce
6
+ metadata.gz: edcd402fc303d9e9fdd8c84c0b06a9b17a11da21fd662955c8ae5664a8a5c6bd1d7669380129d435a8ecc17f607ab6ef40eee25690e4904bb54db29c1fac3197
7
+ data.tar.gz: 7fad342cafc572b1d747ae63db622b8b9a7db8fa880542b56a5628e9390316c959d187299eb2a5216053441251b40508554023e48896e7b1f608cbb74f51050c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bbk-amqp (1.0.0.81661)
4
+ bbk-amqp (1.0.0.82260)
5
5
  activesupport (~> 6.0)
6
6
  bbk-utils (> 1.0.1)
7
7
  bunny (>= 2.19.0)
@@ -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
+ properties[:headers][:user_id] = 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.81661
4
+ version: 1.0.0.82260
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-04-08 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