|
RMQ - RabbitMQ C++ Library
|


Classes | |
| class | Factory |
| struct | SharedState |
Public Types | |
| typedef bsl::unordered_map< bdlb::Guid, rmqp::Producer::ConfirmationCallback > | CallbackMap |
| enum | SendStatus { SENDING , DUPLICATE , TIMEOUT , INFLIGHT_LIMIT , TRANSFORM_ERROR } |
| Possible results of rmqp::Producer::send. | |
| typedef bsl::function< void(const rmqt::Message &, const bsl::string &routingKey, const rmqt::ConfirmResponse &)> | ConfirmationCallback |
| Invoked on receipt of message confirmation. More... | |
Public Member Functions | |
| ProducerImpl (uint16_t maxOutstandingConfirms, const bsl::shared_ptr< rmqamqp::SendChannel > &channel, bdlmt::ThreadPool &threadPool, rmqio::EventLoop &eventLoop) | |
| void | addTransformer (const bsl::shared_ptr< rmqp::MessageTransformer > &transformer) BSLS_KEYWORD_OVERRIDE |
| SendStatus | send (const rmqt::Message &message, const bsl::string &routingKey, const rmqp::Producer::ConfirmationCallback &confirmCallback, const bsls::TimeInterval &timeout) BSLS_KEYWORD_OVERRIDE |
Send a message with the given routingKey to the exchange targeted by the producer. More... | |
| SendStatus | send (const rmqt::Message &message, const bsl::string &routingKey, rmqt::Mandatory::Value mandatoryFlag, const rmqp::Producer::ConfirmationCallback &confirmCallback, const bsls::TimeInterval &timeout) BSLS_KEYWORD_OVERRIDE |
Send a message with the given routingKey to the exchange targeted by the producer. More... | |
| SendStatus | trySend (const rmqt::Message &message, const bsl::string &routingKey, const rmqp::Producer::ConfirmationCallback &confirmCallback) BSLS_KEYWORD_OVERRIDE |
Send a message with the given routingKey to the exchange targeted by the producer. More... | |
| rmqt::Future | updateTopologyAsync (const rmqt::TopologyUpdate &topologyUpdate) BSLS_KEYWORD_OVERRIDE |
| Updates topology. More... | |
| rmqt::Result | waitForConfirms (const bsls::TimeInterval &timeout=bsls::TimeInterval(0)) BSLS_KEYWORD_OVERRIDE |
| Wait for all outstanding publisher confirms to arrive. More... | |
| virtual void | addTransformer (const bsl::shared_ptr< rmqp::MessageTransformer > &transformer)=0 |
| Adds a transformation function to be run on all messages. More... | |
|
inherited |
Invoked on receipt of message confirmation.
The user-provided ConfirmationCallback is invoked once RabbitMQ broker provides a guarantee (publisher confirm) that the message is enqueued.
A ConfirmationCallback implementation should perform any commit action, such as confirming to the sender of the message that the action will be completed. For example, an application which consumes from one queue and produces to another should send the acknowledgement to the first queue once the ConfirmationCallback is invoked from the publish.
|
pure virtualinherited |
Adds a transformation function to be run on all messages.
| transformer | The transformation function |
|
virtual |
Send a message with the given routingKey to the exchange targeted by the producer.
The behavior of this method depends on the the number of unconfirmed messages (sent but not yet confirmed by the broker). If this number is smaller than the limit configured when calling rmqa::VHost::createProducer, this method will return immediately. Otherwise it will block until the unconfirmed message count drops below the limit.
| message | The message to be sent. |
| routingKey | The routing key (e.g. topic or queue name) passed to the exchange. |
| confirmCallback | Called when the broker explicitly confirms/rejects the message. Messages are automatically retried on reconnection, in which case this method may be called some time after invoking send. |
| timeout | How long to wait for as a relative timeout. If timeout is 0, the method will wait to send message indefinitely |
Implements BloombergLP::rmqp::Producer.
Reimplemented in BloombergLP::rmqa::TracingProducerImpl.
|
virtual |
Send a message with the given routingKey to the exchange targeted by the producer.
The behavior of this method depends on the the number of unconfirmed messages (sent but not yet confirmed by the broker). If this number is smaller than the limit configured when calling rmqa::VHost::createProducer, this method will return immediately. Otherwise it will block until the unconfirmed message count drops below the limit.
| message | The message to be sent. |
| routingKey | The routing key (e.g. topic or queue name) passed to the exchange. |
| mandatory | Specify the mandatory flag: RETURN_UNROUTABLE (Recommended): Any messages not passed to a queue are returned to the sender. confirmCallback will be invoked with a RETURN status. DISCARD_UNROUTABLE (Dangerous): Any messages not passed to a queue are confirmed by the broker. This will cause silent message loss in the event bindings aren't setup as expected. |
| confirmCallback | Called when the broker explicitly confirms/rejects the message. Messages are automatically retried on reconnection, in which case this method may be called some time after invoking send. |
| timeout | How long to wait for as a relative timeout. If timeout is 0, the method will wait to send message indefinitely |
Implements BloombergLP::rmqp::Producer.
|
virtual |
Send a message with the given routingKey to the exchange targeted by the producer.
The behavior of this method depends on the the number of unconfirmed messages (sent but not yet confirmed by the broker). If this number is smaller than the limit configured when calling rmqa::VHost::createProducer, this method behaves exactly as the method send. Otherwise, unlike send, this method returns immediately with a result indicating that the unconfirmed message limit has been reached.
| message | The message to be sent. |
| routingKey | The routing key (e.g. topic or queue name) passed to the exchange. |
| confirmCallback | Called when the broker explicitly confirms/rejects the message. Messages are automatically retried on reconnection, in which case this method may be called some time after invoking send. |
Implements BloombergLP::rmqp::Producer.
Reimplemented in BloombergLP::rmqa::TracingProducerImpl.
|
virtual |
Updates topology.
Implements BloombergLP::rmqp::Producer.
|
virtual |
Wait for all outstanding publisher confirms to arrive.
This method allows
| timeout | How long to wait for. If timeout is 0, the method will wait for confirms indefinitely. |
Implements BloombergLP::rmqp::Producer.