retry on error and error handling for dequeuing message