NServiceBus icon indicating copy to clipboard operation
NServiceBus copied to clipboard

It's not obvious that send/publish operations are batched and not necessarily immediate

Open kbaley opened this issue 3 years ago • 0 comments

This issue was transferred from a private repository

The Send, Publish, and Reply operations are 'Async', indicating they are doing IO and even hinting these operations are happening immediately. However, this isn't always the case and users sometimes ask if something is wrong to which we need to explain behavior and guide them to documentation.

This indicates some potential problems:

  1. Why are methods that 'batch' messages async when in 99.999% of cases the API doesn't have to be async? Prevent issues like missing await keyword. Only one specific options will require an async signature. In regards to publishes, there is no need to retrieve subscribers just before dispatching.
  2. Shouldn't the operations be named in a way to indicate they are batched?

kbaley avatar Jul 25 '22 20:07 kbaley