NServiceBus 7.2.0 - Replaying Sucessful Message Leading to Duplicate

When we send Message_A at 2:00 pm
it gets processed and exit handler at 2:00:00:50 within 50 Milli Seconds
Then after 5 minutes by 2:05:00 pm
We get the same message again.

Also, we only get this behaviour occasionally.

Can anyone help

We have tried using this code to resolve the issue but still get the duplicate message.

Thanks in advance

I suspect something is not working as expected and the message is not completed properly. That’s potentially could be the reason why it’s coming back after 5 minutes, which is the lock duration. To assist with this you would need to share more information. I suggest you raise a support save with the details of your endpoint, configuration code, and logs when this happened to help support personal understand what’s happening. You can raise a support case at https://particular.net/support and reference this thread.

What is the next step in the pipeline to mark a message as complete after it has existed the handler?

@samuel-dev-dba a message is not marked as completed by the pipeline. That’s done by transport. The pipeline is invoking transport when messages need to be dispatched.

I suggest raising a support case to get help.

Update: the issue was identified and it was a dependency service injected into the handler. The service was taking too long and causing message lock lost.