Class: RabbitMQ::Actors::TopicProducer
- Inherits:
-
Base::Producer
- Object
- Base::Agent
- Base::Producer
- RabbitMQ::Actors::TopicProducer
- Defined in:
- lib/rabbitmq/actors/patterns/topics/topic_producer.rb
Overview
A producer of messages routed to all the queues bound to the message’s routing_key via matching patterns
Instance Attribute Summary collapse
-
#topic_name ⇒ Object
readonly
Returns the value of attribute topic_name.
Attributes inherited from Base::Agent
Instance Method Summary collapse
-
#initialize(topic_name:, **opts) ⇒ TopicProducer
constructor
A new instance of TopicProducer.
-
#publish(message, message_id:, routing_key:, **opts) ⇒ Object
Send a message to the RabbitMQ server.
Methods inherited from Base::Producer
Constructor Details
#initialize(topic_name:, **opts) ⇒ TopicProducer
Returns a new instance of TopicProducer.
22 23 24 |
# File 'lib/rabbitmq/actors/patterns/topics/topic_producer.rb', line 22 def initialize(topic_name:, **opts) super(opts.merge(topic_name: topic_name)) end |
Instance Attribute Details
#topic_name ⇒ Object (readonly)
Returns the value of attribute topic_name.
17 18 19 |
# File 'lib/rabbitmq/actors/patterns/topics/topic_producer.rb', line 17 def topic_name @topic_name end |
Instance Method Details
#publish(message, message_id:, routing_key:, **opts) ⇒ Object
Send a message to the RabbitMQ server.
44 45 46 |
# File 'lib/rabbitmq/actors/patterns/topics/topic_producer.rb', line 44 def publish(, message_id:, routing_key:, **opts) super(, opts.merge(message_id: , routing_key: routing_key)) end |