# Looks like RabbitMQ output plugin does not support ACK/NACK

**URL:** <https://discuss.elastic.co/t/looks-like-rabbitmq-output-plugin-does-not-support-ack-nack/208484>\
**Category:** Logstash\
**Created:** [November 19, 2019, 10:11am UTC](https://discuss.elastic.co/t/looks-like-rabbitmq-output-plugin-does-not-support-ack-nack/208484 "2019-11-19T10:11:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gab.bernasconi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gab.bernasconi/32/57955_2.png) [@gab.bernasconi](https://discuss.elastic.co/u/gab.bernasconi)\
**Post date:** [November 19, 2019, 10:11am UTC](https://discuss.elastic.co/t/looks-like-rabbitmq-output-plugin-does-not-support-ack-nack/208484/1 "2019-11-19T10:11:30Z")

</div>

Our use case is as follows:

- ELK target version: 6.8.2
- Data comes in via Logstash, where it gets parsed and enriched
- All the data needs to go to Elasticsearch (we use the `elasticsearch` output plugin)
- Some of the data needs to be sent to an external application that performs additional analysis, and for that we use the `rabbitmq` output to pass data to RabbitMQ
- The external application consumes from RabbitMQ and does its thing

Other important things to consider:

- RabbitMQ queues are all limited (e.g. 100 MB), as this is an unsupervised installation
- RabbitMQ overflow policy is set to `reject-publish`, as we don't want to lose any data item that has been enqueued
- It is **OK** for us for RabbitMQ to put back-pressure on Logstash - in fact, this is the desired behavior: if the RabbitMQ queue is full, the whole Logstash pipeline slows down

This does not seem to be possible with the current `rabbitmq` output plugin, as it does not wait for ACK (or NACK, in this case) from RabbitMQ: it keeps sending data to RabbitMQ, ignoring its answers.

I see there is an `ack` option in the RabbitMQ input (see [here](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-rabbitmq.html#plugins-inputs-rabbitmq-ack)); however, it doesn't seem to be anything similar in the output plugin.

I know setting this option will hurt throughput, but this is exactly our use case: we **want** to lower throughput when the queue is full, and enter an infinite retry loop to re-publish rejected messages.

We tried using a custom `ruby` filter to obtain the behavior, and we successfully did it by adding an explicit call to `channel.wait_for_confirms` after the call to `publish()`.

Am I missing something? Is this a potential welcome addition to the RabbitMQ output plugin?

Thanks,  
Gabriele

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [November 19, 2019, 3:28pm UTC](https://discuss.elastic.co/t/looks-like-rabbitmq-output-plugin-does-not-support-ack-nack/208484/2 "2019-11-19T15:28:40Z")

</div>

> [@gab.bernasconi](#):
>
> Is this a potential welcome addition to the RabbitMQ output plugin?

Yes, but not if it disables connection recovery. See [this](https://github.com/logstash-plugins/logstash-output-rabbitmq/issues/85) issue.

---

<div class="post-metadata">

**Author:** ![gab.bernasconi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gab.bernasconi/32/57955_2.png) [@gab.bernasconi](https://discuss.elastic.co/u/gab.bernasconi)\
**Post date:** [November 19, 2019, 3:44pm UTC](https://discuss.elastic.co/t/looks-like-rabbitmq-output-plugin-does-not-support-ack-nack/208484/3 "2019-11-19T15:44:25Z")

</div>

Thank you! I did a search on Github, but I wasn't able to find anything related. I will comment on the linked issue.

---

<div class="post-metadata">

**Author:** ![gab.bernasconi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gab.bernasconi/32/57955_2.png) [@gab.bernasconi](https://discuss.elastic.co/u/gab.bernasconi)\
**Post date:** [November 22, 2019, 11:35am UTC](https://discuss.elastic.co/t/looks-like-rabbitmq-output-plugin-does-not-support-ack-nack/208484/4 "2019-11-22T11:35:55Z")

</div>

For anyone reading this: the feature has been included in Logstash 6.8.4 (see [here](https://www.elastic.co/guide/en/logstash/6.8/logstash-6-8-4.html)).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 20, 2019, 11:35am UTC](https://discuss.elastic.co/t/looks-like-rabbitmq-output-plugin-does-not-support-ack-nack/208484/5 "2019-12-20T11:35:58Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
