userver: urabbitmq::IChannelInterface Class Reference
Loading...
Searching...
No Matches
urabbitmq::IChannelInterface Class Referenceabstract

#include <userver/urabbitmq/broker_interface.hpp>

Detailed Description

Publisher interface for the broker. This class is merely an interface for convenience and you are not expected to use it directly (use Client/Channel instead).

Definition at line 82 of file broker_interface.hpp.

+ Inheritance diagram for urabbitmq::IChannelInterface:

Public Member Functions

virtual void Publish (const Exchange &exchange, const std::string &routing_key, const std::string &message, MessageType type, engine::Deadline deadline)=0
 Publish a message to an exchange.
 
virtual void Publish (const Exchange &exchange, const std::string &routing_key, const std::string &message, engine::Deadline deadline)=0
 overload of Publish
 
virtual std::string Get (const Queue &queue, utils::Flags< Queue::Flags > flags, engine::Deadline deadline)=0
 Gets a single message.
 

Member Function Documentation

◆ Get()

virtual std::string urabbitmq::IChannelInterface::Get ( const Queue & queue,
utils::Flags< Queue::Flags > flags,
engine::Deadline deadline )
pure virtual

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.

Note
This method uses a polling model for retrieving a message, which is comparatively expensive and might lead to a connection reset in case of a timeout. This method could come in handy in some cases, but in general we recommend to set up a Consumer instead.
Parameters
queuename of the queue
flagsqueue flags
deadlineexecution deadline

Implemented in urabbitmq::Channel, and urabbitmq::Client.

◆ Publish() [1/2]

virtual void urabbitmq::IChannelInterface::Publish ( const Exchange & exchange,
const std::string & routing_key,
const std::string & message,
engine::Deadline deadline )
pure virtual

overload of Publish

Implemented in urabbitmq::Channel, and urabbitmq::Client.

◆ Publish() [2/2]

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

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.

Implemented in urabbitmq::Channel, and urabbitmq::Client.


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