🎄 Happy Holidays! 🥳

Most of Solace is closed December 24–January 1 so our employees can spend time with their families. We will re-open Thursday, January 2, 2024. Please expect slower response times during this period and open a support ticket for anything needing immediate assistance.

Happy Holidays!

Please note: most of Solace is closed December 25–January 2, and will re-open Tuesday, January 3, 2023.

Looking for a best Practices for Handling Unacknowledged Messages in Solace Consumer Applications

hobart
hobart Member Posts: 3
edited November 19 in PubSub+ Event Broker #1

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


Tagged:

Answers

  • Aaron
    Aaron Member, Administrator, Moderator, Employee Posts: 644 admin

    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?

  • hobart
    hobart Member Posts: 3

    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.