Looking for a best Practices for Handling Unacknowledged Messages in Solace Consumer Applications
What is the best practice to avoid a situation where the consumer reaches the maximum number of unacknowledged messages, causing Solace to stop sending messages and leaving the client uncertain whether to continue listening or restart the application? Should the consumer application periodically restart the client or periodically terminate and restart the messaging service to ensure automated and reliable message consumption?
Working environment: Python
Answers
-
Hi @hobart. Your consumer application should be acknowledging messages as it finishes with them: finished processing them, storing them, whatever it is your app is doing with the data. Call the
ack()
function on each message when the message data has been safely processed. Typically apps don't hold onto messages for very long (unless maybe doing some big batch processing), but still once you've batched/committed them someplace safe, you'd acknowledge all those messages and continue receiving new ones.The default is 10,000 unacked messages per flow. Are you constantly running into that limit with your app, and the broker stops sending you messages? Why do you need to hold onto so many messages?
0