I have read types of transactions which are supported by Nservicebus but I got confused about the ReceiveOnly and Sends atomic with Receive in Nservicebusbus. can anyone describe it for me a little more detail?
ReceiveOnly :
In this mode the receive operation is wrapped in a transport's native transaction. This mode guarantees that the message is not permanently deleted from the incoming queue until there is at least one processing attempt (including storing user data and sending out messages) finished successfully.
Eg: In Azure Service Bus and Azure Storage Queues, the message is not removed from the queue after it is received, but rather its hidden for some duration. This prevents other instances from receiving the message. If the receiver fails to process the message within that time frame or explicitly abandons the message, then the message will become visible again. Other instances will be able to pick it up (effectively rolling back the incoming message).
SendsAtomicWithReceive:
This mode is similar to the ReceiveOnly, but transaction is shared with sending operations as well. That means the message receive operation and any send or publish operations are all committed atomically i.e., all outgoing operations are atomic with the ongoing receive operation.
NServiceBus documentation: https://docs.particular.net/transports/transactions