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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/bbk/amqp/publisher.rb +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f79016d5cab4da9644abbb93ad71897c24a93a473bd21cf223ea3fd6eebaa7d
|
4
|
+
data.tar.gz: bcbcf9d71e111c5b6a8c9efe48ead69a46d0804890b6601be32571a57ee926d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edcd402fc303d9e9fdd8c84c0b06a9b17a11da21fd662955c8ae5664a8a5c6bd1d7669380129d435a8ecc17f607ab6ef40eee25690e4904bb54db29c1fac3197
|
7
|
+
data.tar.gz: 7fad342cafc572b1d747ae63db622b8b9a7db8fa880542b56a5628e9390316c959d187299eb2a5216053441251b40508554023e48896e7b1f608cbb74f51050c
|
data/Gemfile.lock
CHANGED
data/lib/bbk/amqp/publisher.rb
CHANGED
@@ -8,7 +8,7 @@ module BBK
|
|
8
8
|
# Publisher send amqp messages
|
9
9
|
class Publisher
|
10
10
|
|
11
|
-
HEADER_PROP_FIELDS = %i[
|
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,
|
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.
|
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-
|
11
|
+
date: 2022-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|