Search code examples
nservicebus

NServiceBus occasionally replays old messages


The service hosted in AWS (multiple instances managed by kubernetes), using in-memory persistence and SqlServerTransport has been caught occasionally replaying old messages (6-7 hours old). No failures.

The replay is typically initiated by the same container as the one which handles "normal" messages. DB tables associated with NSB are empty. Any advice on how to tackle the problem would be appreciated.


Solution

  • Based on the limited details provided, here are several things you can consider to troubleshoot these replayed messages. If these do not help it would be best to contact Particular Software support so we can help troubleshoot.

    • Have you checked your NServiceBus logs? You may want to increase your logging level to get more information about these messages.
    • Have you customized your delayed retry recoverability settings? By default, any message will have long since been sent to the common error queue by the time 6 hours have elapsed.
    • Are you using delayed delivery with your messages?
    • Is there a Saga timeout involved with this message?
    • Are you sure the code that is sending the message is not sending duplicates? Have you confirmed the Message ID for the message is the same as the previous time it was processed? Auditing your messages is useful for troubleshooting these types of issues.