Good naming of your methods can solve a lot of customer issues.
I use NServiceBus as messaging framework in dotnet. I was using a method of this framework, which wasn’t doing what I was expected.
NServiceBus uses a UnitOfWork pattern when sending messages. I was using the method RequireImmediateDispatch()
, This flags NServiceBus to dispatch messages immediate, instead of sending them at the end of the UnitOfWork.
Apparently, there is also a method to check if this flag is set. This method is called RequiredImmediateDispatch()
. Did you see the problem?
I didn’t. It is only different by one letter.
I used the wrong one in my code and that resulted in strange behavior that I couldn’t explain.
In NServiceBus 8 this method is now renamed to IsImmediateDispatchSet()
which hopfully prevents my mistake happing to other users.