# Handling unknown events arriving to queue

**URL:** <https://forum.flowable.org/t/handling-unknown-events-arriving-to-queue/7003>\
**Category:** Flowable Engine\
**Created:** [November 1, 2020, 7:42am UTC](https://forum.flowable.org/t/handling-unknown-events-arriving-to-queue/7003 "2020-11-01T07:42:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![iadded](https://avatars.discourse-cdn.com/v4/letter/i/9dc877/32.png) [@iadded](https://forum.flowable.org/u/iadded)\
**Post date:** [November 1, 2020, 7:42am UTC](https://forum.flowable.org/t/handling-unknown-events-arriving-to-queue/7003/1 "2020-11-01T07:42:14Z")

</div>

Hi

I’m using the event registry and RabbitMQ.  
I have an inbound queue defined - and a few events each with a separate eventKey - and all flows work fine.  
But I noticed that if by mistake - i send an event to the queue with a wrong event key - flowable tries to consume it endlessly - and throws an exception of “no event definitions deployed with key” each time.

Since i assume that such “unknown” messages might arrive to the queue - is there a way to configure flowable to “drop/ignore” those messages instead of going into this endless retries ? If not - what would be the best approach for me to handle that ?

Thanks  
Inbal

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [November 2, 2020, 7:55am UTC](https://forum.flowable.org/t/handling-unknown-events-arriving-to-queue/7003/2 "2020-11-02T07:55:00Z")

</div>

Hey @iadded,

In my opinion this should be handled by the queue itself. Almost every queue has the concept of dead letter queues. This means that if a message is rejected or an error is happened during consumption the message would be moved to a different queue that can be handled specially. You can then modify the payload and resent the event, or completely discard the message.

The reason why flowable tries to consume it endlessly is most likely because you have not configured your queue to have a dead letter queue.

Cheers,  
Filip

---

<div class="post-metadata">

**Author:** ![iadded](https://avatars.discourse-cdn.com/v4/letter/i/9dc877/32.png) [@iadded](https://forum.flowable.org/u/iadded)\
**Post date:** [November 2, 2020, 7:57am UTC](https://forum.flowable.org/t/handling-unknown-events-arriving-to-queue/7003/3 "2020-11-02T07:57:09Z")

</div>

Thanks Filip - as i’m new to both flowable and queue - i was not aware with this option.  
Will try setting this up on my queue

Thanks  
Inbal

---

<div class="post-metadata">

**Author:** ![iadded](https://avatars.discourse-cdn.com/v4/letter/i/9dc877/32.png) [@iadded](https://forum.flowable.org/u/iadded)\
**Post date:** [November 2, 2020, 1:12pm UTC](https://forum.flowable.org/t/handling-unknown-events-arriving-to-queue/7003/4 "2020-11-02T13:12:17Z")

</div>

Hey @filiphr

So - i did my homework - configured my RabbitMQ correctly - set it up with dead letter queue - and tested it manually - its working ok.  
But - in order for the messages to be moved to the dead letter queue - you need to reject with re-queue = false - and i think Flowable is not doing that.  
If i manually get message from queue and reject with re-queue=false - message is moved to dead letter queue. But with flowable it remains in the queue forever - so i assume flowable is not sending reject - or its sending reject with re-queue=true.  
I could not find in the code this logic - but i’m probably missing something.

Will be great to get any advice on this one  
Thanks  
Inbal

---

<div class="post-metadata">

**Author:** ![iadded](https://avatars.discourse-cdn.com/v4/letter/i/9dc877/32.png) [@iadded](https://forum.flowable.org/u/iadded)\
**Post date:** [November 2, 2020, 1:33pm UTC](https://forum.flowable.org/t/handling-unknown-events-arriving-to-queue/7003/5 "2020-11-02T13:33:03Z")

</div>

Ok - some more digging - and i found the solution  
Need to add this to the configuration

spring.rabbitmq.listener.simple.default-requeue-rejected = false

And now it works 🙂

Thanks again for all your responses  
Inbal
