NServiceBus sendonly retry

Do we have a retry mechanism in NServicebus when sending from a SendOnly endpoint (not within a MessageHandler)?

I am sending commands with RabbitMQ transport.

When IMessageSession Send completes, I am guaranteed the message is safe, right?

Retrying is only performed as part of message processing.

When Send/Publish is awaited and returns then the message is dispatched to the transport when using RabbitMQ.

However, the Send/Publish could fail. If you would want to have some retry capability when this isn’t part of an incoming message like an REST API that sends a message you could use a Polly retry policy to wrap the send.

OK I will use a 3rd party retry lib.

Still a little confused why NSB doesn’t offers me a retry mechanism here.

@Stig_Christensen its because the sending of messages likely is part of a bigger unit of work that could do multiple tasks of which of is the sending of one or more messages.

Maybe we could improve our framework in this area. Could you describe your use case of which the sending of a message in a send-only endpoint is performed?

There is really nothing to elaborate. You could argue, that the calling process/framework has the retry responsibility. I just didn’t want to implement and test this, if already build into NSB.