summaryrefslogtreecommitdiff
path: root/librabbitmq
diff options
context:
space:
mode:
authorAlan Antonuk <alan.antonuk@gmail.com>2013-08-25 23:50:12 -0700
committerAlan Antonuk <alan.antonuk@gmail.com>2013-08-25 23:50:12 -0700
commit9b168776fb0b4096492e676d58b1645ddfff2f91 (patch)
treeee24086f7492edd070e63f65a2f281d2bfa65c49 /librabbitmq
parente5fa602cb7dd66d847c8ef0c98fae582acc7b9a5 (diff)
downloadrabbitmq-c-github-ask-9b168776fb0b4096492e676d58b1645ddfff2f91.tar.gz
Add amqp_basic_nack() API function
Diffstat (limited to 'librabbitmq')
-rw-r--r--librabbitmq/amqp.h24
-rw-r--r--librabbitmq/amqp_api.c11
2 files changed, 35 insertions, 0 deletions
diff --git a/librabbitmq/amqp.h b/librabbitmq/amqp.h
index 533f8ec..1f5d2da 100644
--- a/librabbitmq/amqp.h
+++ b/librabbitmq/amqp.h
@@ -1928,6 +1928,30 @@ AMQP_CALL amqp_basic_reject(amqp_connection_state_t state, amqp_channel_t channe
uint64_t delivery_tag, amqp_boolean_t requeue);
/**
+ * Do a basic.nack
+ *
+ * Actively reject a message, this has the same effect as amqp_basic_reject()
+ * however, amqp_basic_nack() can negatively acknowledge multiple messages with
+ * one call much like amqp_basic_ack() can acknowledge mutliple messages with
+ * one call.
+ *
+ * \param [in] state the connection object
+ * \param [in] channel the channel identifier
+ * \param [in] delivery_tag the delivery tag of the message to reject
+ * \param [in] multiple if set to 1 negatively acknowledge all unacknowledged
+ * messages on this channel.
+ * \param [in] requeue indicate to the broker whether it should requeue the
+ * message or dead-letter it.
+ * \return AMQP_STATUS_OK on success, an amqp_status_enum value otherwise.
+ *
+ * \since v0.5.0
+ */
+AMQP_PUBLIC_FUNCTION
+int
+AMQP_CALL amqp_basic_nack(amqp_connection_state_t state, amqp_channel_t channel,
+ uint64_t delivery_tag, amqp_boolean_t multiple,
+ amqp_boolean_t requeue);
+/**
* Check to see if there is data left in the receive buffer
*
* Can be used to see if there is data still in the buffer, if so
diff --git a/librabbitmq/amqp_api.c b/librabbitmq/amqp_api.c
index 2f40681..1dd303e 100644
--- a/librabbitmq/amqp_api.c
+++ b/librabbitmq/amqp_api.c
@@ -327,3 +327,14 @@ int amqp_basic_reject(amqp_connection_state_t state,
req.requeue = requeue;
return amqp_send_method(state, channel, AMQP_BASIC_REJECT_METHOD, &req);
}
+
+int amqp_basic_nack(amqp_connection_state_t state, amqp_channel_t channel,
+ uint64_t delivery_tag, amqp_boolean_t multiple,
+ amqp_boolean_t requeue)
+{
+ amqp_basic_nack_t req;
+ req.delivery_tag = delivery_tag;
+ req.multiple = multiple;
+ req.requeue = requeue;
+ return amqp_send_method(state, channel, AMQP_BASIC_NACK_METHOD, &req);
+}