I was consider a similar design.. But in my scenario, the "infinite loop" is ok. The consumer is supposed to keep polling and processing. If it's failing again and again, just add it to the retry queue again and again. It means the downstream service(the service which is called for each message) is down. If you want to prevent the potential loop, just let the consumer thread run for a certain period of time.