|
RMQ - RabbitMQ C++ Library
|


Classes | |
| class | Factory |
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 | |
| TracingProducerImpl (uint16_t maxOutstandingConfirms, const bsl::shared_ptr< rmqamqp::SendChannel > &channel, bdlmt::ThreadPool &threadPool, rmqio::EventLoop &eventLoop, const bsl::string &exchangeName, const bsl::shared_ptr< const rmqt::Endpoint > &endpoint, const bsl::shared_ptr< rmqp::ProducerTracing > &tracing) | |
| 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 | 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... | |
| void | addTransformer (const bsl::shared_ptr< rmqp::MessageTransformer > &transformer) BSLS_KEYWORD_OVERRIDE |
| virtual void | addTransformer (const bsl::shared_ptr< rmqp::MessageTransformer > &transformer)=0 |
| Adds a transformation function to be run on all messages. 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... | |
| 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... | |
|
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.
Callbacks are invoked on a thread pool thread without holding any internal locks. It is safe to call send or trySend from within a ConfirmationCallback. Multiple callbacks may execute concurrently on different thread pool threads.
|
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 |
Reimplemented from BloombergLP::rmqa::ProducerImpl.
|
virtualinherited |
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. |
Reimplemented from BloombergLP::rmqa::ProducerImpl.
|
virtualinherited |
Updates topology.
Implements BloombergLP::rmqp::Producer.
|
virtualinherited |
Wait for all outstanding publisher confirms to arrive.
Blocks the calling thread until every previously sent message has received a publisher confirm from the broker (or the timeout expires). All corresponding ConfirmationCallbacks will have completed before this method returns. Note that messages sent from within a ConfirmationCallback will not be covered by an in-progress waitForConfirms call; a subsequent call is needed to wait for those.
| timeout | How long to wait for. If timeout is 0, the method will wait for confirms indefinitely. |
Implements BloombergLP::rmqp::Producer.