#include <userver/urabbitmq/channel.hpp>
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.
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 | |
std::string | Get (const Queue &queue, utils::Flags< Queue::Flags > flags, engine::Deadline deadline) override |
Gets a single message. | |
|
overridevirtual |
Gets a single message.
You should to set kNoAck
flag in order for server to implicitly acknowledge gathered message. By default the gathered message has to be explicitly acknowledged or rejected, however there's no functionality for that yet, so the flag is basically mandatory. This API is a subject to change.
Consumer
instead.queue | name of the queue |
flags | queue flags |
deadline | execution deadline |
Implements urabbitmq::IChannelInterface.
|
inlineoverridevirtual |
overload of Publish
Implements urabbitmq::IChannelInterface.
Definition at line 43 of file channel.hpp.
|
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
exchange | the exchange to publish to |
routing_key | the routing key |
message | the message to send |
deadline | execution deadline |
fire and forget
(no delivery guarantees), use PublishReliable
for delivery guarantees. Implements urabbitmq::IChannelInterface.