Introduction to NServiceBus

The best way to get started with NServiceBus is to use it to build something realistic. In doing so you'll learn the architectural concepts behind the software, and start to learn its capabilities. In this tutorial, you'll be building a back end for a retail e-commerce system. You'll learn how to send asynchronous messages between processes, how to use the Publish/Subscribe pattern to decouple business processes, and the advantages of using reliable messaging to enable automatic retries after processing failures.

The tutorial is divided into five lessons, each of which can be accomplished in a half hour or less — perfect for your lunch break.

  • Lesson 1: Getting started (10-15 minutes) - learn how to set up your development environment and create your very first messaging endpoint.

  • Lesson 2: Sending a command (15-20 minutes) - learn how to define messages and message handlers, and send your first message.

  • Lesson 3: Multiple endpoints (15-20 minutes) - learn how to create multiple endpoints and send messages between them.

  • Lesson 4: Publishing events (25-30 minutes) - learn about the Publish/Subscribe pattern, how to publish events to multiple subscribers, and about the benefits of using this pattern to decouple business processes.

  • Lesson 5: Retrying errors (25-30 minutes) - learn how to use the Particular Service Platform tools to gracefully recover from exceptions in your code, allowing you to build systems that are resistant to failure.

When you've completed all the exercises, your solution will look like this:

Completed Solution Diagram

Go to Lesson 1: Getting started to begin.


Last modified