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


One of the greatest strengths of NServiceBus is that it allows you to easily add scalability to any system. We can easily add more threads to scale up, or distribute the processing of messages among multiple servers to scale out.

Scaling up

Multithreading is hard. If you've ever tried to design a multithreaded program, then you already know this. NServiceBus makes this a lot easier because it has already divided all our work into messages that represent discrete, independent tasks. So as long as we don't do anything stupid in our message handlers (such as sharing state), we can allow NServiceBus to ramp up the number of threads that process messages with relative safety.

This gives service applications the same flexibility that web servers enjoy. In the same way that HTTP requests are processed by a web server, largely in parallel by multiple threads, an NServiceBus endpoint can process messages on multiple threads. The difference is that a web server must process all incoming requests...