Book Image

Learning NServiceBus - Second Edition

By : David Boike
Book Image

Learning NServiceBus - Second Edition

By: David Boike

Overview of this book

Table of Contents (18 chapters)
Learning NServiceBus Second Edition
About the Author
About the Reviewers

Commands versus events

In the previous chapter, the MVC website sent a command to the NServiceBus endpoint, commanding it to perform an action on its behalf. This is similar to a web service or any other Remote Procedure Call (RPC) style of communication. The message sender must necessarily know not only how to communicate with the receiver but also what it expects the server to do once it receives the message.


A command is a message that can be sent from one or more logical senders and is processed by a single logical receiver.

The main difference between sending an NServiceBus command and an RPC request is that an RPC call will block the client until the server sends a response back. There is no way that the client can continue without the response. Sending an NServiceBus command, however, is completely asynchronous.

Eventual consistency

The asynchronous nature of one-way messages brings to the forefront the concept of eventual consistency, the notion that in a system with disconnected...