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 -
Hi Aaron,
In the application layer, there are no issues with performing ACK or NACK operations. The problems arise from the connections between the Solace consumer and broker. We have many nodes between the Solace consumer and broker, each with its own maintenance schedule. Due to this, underlying signaling may be lost, resulting in the consumer being unaware that the broker is still waiting for an ACK or NACK.
To address this, we are looking for an automation mechanism that can help us prevent this situation.
I hope this helps clarify the situation. Please let me know if you need any further information.
0