bbk-amqp 1.1.0.199449 → 1.1.0.199673

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: e798134a7800aeed5412ddc107f9f7c0ca29d09dbb277934f75c8c5bcd726640
4
- data.tar.gz: 1772b61d79191368a8abbff1cac88d700c6f050fb8a640334cf3f8947b54d307
3
+ metadata.gz: f0b21d66df4389ae96920aa75d3aee69e1c97cbd8919aceaeeb7fea411d4c643
4
+ data.tar.gz: d9791ff11d25ce1d46a62ad09b59327d06dbc1ac12760f912babdf8da45ae79e
5
5
  SHA512:
6
- metadata.gz: 2e47783aec3de66a411746ffadd1784e96947515dc39a7c7fe21812d8349311f79b42e5e88770666e7b3c42196d4d6fba2f68ce069f227950608b7a9e4616546
7
- data.tar.gz: f192cc73a9c43f7ef00646beba9d26f19de2b5cf27cdb838fe061cc1940fe8a68c96a57c8f54b4848d483f08f7734b3698274f8fd38dfea7e008cd6f2dc27402
6
+ metadata.gz: 88298615abd56544b85c53066290a6dc9f39f5e5f338b90027645f9c2d612544c269ab7b35a588d9956e608d7b165e5ca00f26b5f389fb6151ae3323d1d84c80
7
+ data.tar.gz: 8f2f0d852f3bdf6aa63a65d5f1516ab32a2487f46e52e7ad6ba0072619eadc5b9bce2fe9e22bd02ed9acbee64235ce1f778c57b97420e35e8c1f2582d7bc795b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bbk-amqp (1.1.0.199449)
4
+ bbk-amqp (1.1.0.199673)
5
5
  activesupport (>= 6.0)
6
6
  bbk-utils (> 1.0.1)
7
7
  bunny (>= 2.19.0)
@@ -11,6 +11,18 @@ module BBK
11
11
  HEADER_PROP_FIELDS = %i[message_id reply_to correlation_id].freeze
12
12
  PROTOCOLS = %w[mq amqp amqps].freeze
13
13
 
14
+ class PublishedMessage
15
+
16
+ attr_reader :headers, :payload
17
+
18
+ def initialize(headers, payload)
19
+ @headers = headers
20
+ @payload = payload
21
+ end
22
+
23
+ end
24
+
25
+
14
26
  attr_reader :connection, :domains, :logger, :channel, :ack_map, :sended_messages, :channel
15
27
 
16
28
  def initialize(connection, domains, logger: BBK::AMQP.logger)
@@ -57,7 +69,7 @@ module BBK
57
69
 
58
70
  route_info = domain.call(route)
59
71
  message = result.message
60
- publish_message(route_info.routing_key, message, exchange: route_info.exchange)
72
+ publish_message(route_info.routing_key, PublishedMessage.new({**message.headers, **route_info.headers}, message.payload), exchange: route_info.exchange)
61
73
  end
62
74
 
63
75
  # Publish message
@@ -2,11 +2,12 @@ module BBK
2
2
  module AMQP
3
3
  class RouteInfo
4
4
 
5
- attr_reader :exchange, :routing_key
5
+ attr_reader :exchange, :routing_key, :headers
6
6
 
7
- def initialize(exchange, routing_key)
7
+ def initialize(exchange, routing_key, **headers_params)
8
8
  @exchange = exchange
9
9
  @routing_key = routing_key
10
+ @headers = headers_params
10
11
  end
11
12
 
12
13
  end
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.1.0.199449
4
+ version: 1.1.0.199673
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samoylenko Yuri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-05 00:00:00.000000000 Z
11
+ date: 2023-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport