# RabbitMQ input plugin with empty payload

**URL:** <https://discuss.elastic.co/t/rabbitmq-input-plugin-with-empty-payload/195927>\
**Category:** Logstash\
**Created:** [August 20, 2019, 12:21pm UTC](https://discuss.elastic.co/t/rabbitmq-input-plugin-with-empty-payload/195927 "2019-08-20T12:21:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Efstathios\_Xagoraris](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/efstathios_xagoraris/32/52618_2.png) [@Efstathios\_Xagoraris](https://discuss.elastic.co/u/Efstathios_Xagoraris)\
**Post date:** [August 20, 2019, 12:21pm UTC](https://discuss.elastic.co/t/rabbitmq-input-plugin-with-empty-payload/195927/1 "2019-08-20T12:21:17Z")

</div>

Hello,

I am wondering if other users are experiencing the same issue. I have a rabbitmq server with the [event exchange](https://www.rabbitmq.com/event-exchange.html) plugin enabled. I would like to use logstash to consume the messages:

The configuration is straightforward

```auto
input {
    rabbitmq {
        host => "localhost"
        exchange => "amq.rabbitmq.event"
        key => "user.created"
        queue => "audit-events"
        user => "xxx"
        metadata_enabled => "true"
        password => "xxx"
    }

}

output {
      stdout {}
    }

```

Although I can see messages going in the exchange and logstash creating a binding/consumer and ACKing the messages, the message don't appear in the output. I tried various debug flags but no luck. I wrote a custom consumer and I saw that for this particular use case the payload of the message is empty. The data I want are in the headers of the message. I have a feeling that logstash rabbitmq plugin will ignore messages with an empty payload because when I try and push a message I with a non empty payload, I can see ending up in stdout.

Has any of you seen anything similar. Not sure if that is a bug or is normal.

Thanks,  
Efstathios X

---

<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:** [August 20, 2019, 12:39pm UTC](https://discuss.elastic.co/t/rabbitmq-input-plugin-with-empty-payload/195927/2 "2019-08-20T12:39:58Z")

</div>

If I am reading it correctly then the code will convert an empty payload into an array containing zero events, so nothing will get flushed to the pipeline. I think this is working as expected.

---

<div class="post-metadata">

**Author:** ![Efstathios\_Xagoraris](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/efstathios_xagoraris/32/52618_2.png) [@Efstathios\_Xagoraris](https://discuss.elastic.co/u/Efstathios_Xagoraris)\
**Post date:** [August 20, 2019, 1:21pm UTC](https://discuss.elastic.co/t/rabbitmq-input-plugin-with-empty-payload/195927/3 "2019-08-20T13:21:37Z")

</div>

Thanks Badger, I was expecting by having metadata\_enabled =\> true to at least get the metadata.headers that I wanted but looks like it doesn't work.

Cheers

---

<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:** [September 17, 2019, 1:21pm UTC](https://discuss.elastic.co/t/rabbitmq-input-plugin-with-empty-payload/195927/4 "2019-09-17T13:21:38Z")

</div>

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