Handling unknown events arriving to queue

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

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

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

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

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 :slight_smile:

Thanks again for all your responses
Inbal