Class: RabbitMQ::Actors::RoutingProducer
- Inherits:
-
Base::Producer
- Object
- Base::Agent
- Base::Producer
- RabbitMQ::Actors::RoutingProducer
- Defined in:
- lib/rabbitmq/actors/patterns/routing/routing_producer.rb
Overview
A producer of messages routed to all the queues bound to the message’s routing_key
Instance Attribute Summary collapse
-
#exchange_name ⇒ Object
readonly
Returns the value of attribute exchange_name.
Attributes inherited from Base::Agent
Instance Method Summary collapse
-
#initialize(exchange_name:, **opts) ⇒ RoutingProducer
constructor
A new instance of RoutingProducer.
-
#publish(message, message_id:, routing_key:, **opts) ⇒ Object
Send a message to the RabbitMQ server.
Methods inherited from Base::Producer
Constructor Details
#initialize(exchange_name:, **opts) ⇒ RoutingProducer
Returns a new instance of RoutingProducer.
33 34 35 |
# File 'lib/rabbitmq/actors/patterns/routing/routing_producer.rb', line 33 def initialize(exchange_name:, **opts) super(opts.merge(exchange_name: exchange_name)) end |
Instance Attribute Details
#exchange_name ⇒ Object (readonly)
Returns the value of attribute exchange_name.
28 29 30 |
# File 'lib/rabbitmq/actors/patterns/routing/routing_producer.rb', line 28 def exchange_name @exchange_name end |
Instance Method Details
#publish(message, message_id:, routing_key:, **opts) ⇒ Object
Send a message to the RabbitMQ server.
55 56 57 |
# File 'lib/rabbitmq/actors/patterns/routing/routing_producer.rb', line 55 def publish(, message_id:, routing_key:, **opts) super(, opts.merge(message_id: , routing_key: routing_key)) end |