userver: urabbitmq::Channel Class Reference
Loading...
Searching...
No Matches
urabbitmq::Channel Class Referencefinal

Publisher interface for the broker. You may use this class to publish your messages. More...

#include <userver/urabbitmq/channel.hpp>

+ Inheritance diagram for urabbitmq::Channel:
+ Collaboration diagram for urabbitmq::Channel:

Public Member Functions

 Channel (ConnectionPtr &&channel)
 
 Channel (Channel &&other) noexcept
 
void Publish (const Exchange &exchange, const std::string &routing_key, const std::string &message, MessageType type, engine::Deadline deadline) override
 Publish a message to an exchange.
 
void Publish (const Exchange &exchange, const std::string &routing_key, const std::string &message, engine::Deadline deadline) override
 overload of Publish
 

Detailed Description

Publisher interface for the broker. You may use this class to publish your messages.

You may as well use Client itself instead, this class just gives you some order guaranties.

You are not expected to store this class for a long time, because it takes a connection from the underlying connections pool.

Usually retrieved from Client.

Definition at line 28 of file channel.hpp.

Member Function Documentation

◆ Publish() [1/2]

void urabbitmq::Channel::Publish ( const Exchange exchange,
const std::string &  routing_key,
const std::string &  message,
engine::Deadline  deadline 
)
inlineoverridevirtual

overload of Publish

Implements urabbitmq::IChannelInterface.

Definition at line 39 of file channel.hpp.

◆ Publish() [2/2]

void urabbitmq::Channel::Publish ( const Exchange exchange,
const std::string &  routing_key,
const std::string &  message,
MessageType  type,
engine::Deadline  deadline 
)
overridevirtual

Publish a message to an exchange.

You have to supply the name of the exchange and a routing key. RabbitMQ will then try to send the message to one or more queues. By default unroutable messages are silently discarded

Parameters
exchangethe exchange to publish to
routing_keythe routing key
messagethe message to send
deadlineexecution deadline
Note
This method is fire and forget (no delivery guarantees), use PublishReliable for delivery guarantees.

Implements urabbitmq::IChannelInterface.


The documentation for this class was generated from the following file: