bbk-amqp 1.1.0.199382 → 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: 86140e82b53726ba9078d467c82a4015e16cb72312464c63d9614aa3a1ebb2ad
4
- data.tar.gz: 531fc4b1ba3b80a87367752304952d072b8a958666ecc9e7c8e3f1f760fc57ae
3
+ metadata.gz: f0b21d66df4389ae96920aa75d3aee69e1c97cbd8919aceaeeb7fea411d4c643
4
+ data.tar.gz: d9791ff11d25ce1d46a62ad09b59327d06dbc1ac12760f912babdf8da45ae79e
5
5
  SHA512:
6
- metadata.gz: 595646b8b5241f8f83ef862a201a0bf258b69a2e68499599b19050373b1dd31a3252a183fd1ccf06074aa6f6d6cd592d404ac3f1b4da960bd0a78fd6b6a5000a
7
- data.tar.gz: 28f5b861855f1d6f8f504e1473d4d7de96bbe2a1f5cd9d30089f494311866633f34009c02df7474305c95f9a0cea706e2263f3b75a4af35459776b5670c71a3a
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.199382)
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)
@@ -49,6 +49,10 @@ module BBK
49
49
  self.class.new(consumer, delivery_info, properties, body)
50
50
  end
51
51
 
52
+ def protocol
53
+ consumer&.protocols&.first
54
+ end
55
+
52
56
  end
53
57
  end
54
58
  end
@@ -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.199382
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