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
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Events


If you compare the following definition with that of a command, which was defined earlier in the chapter, you will notice that they follow the same general premise, but the differences are very important.

Note

An event is a message that is published from a single logical sender, and is processed by one or more logical receivers.

A command can be sent by any number of different senders. An event is only published by one logical sender. Sending a command sends one copy of a message to one receiver, and that receiver is the only entity that can process that command. In contrast, when an event is published, a copy of that message may be sent to dozens or even hundreds of subscribers, or maybe none if there are no subscribers.

This has even broader implications. While a command is an order to do something in the future, an event is an announcement that something has already happened. This is why commands are often named in the imperative, such as DoSomethingNowPleaseCmd, while events are often...