Book Image

Learning NServiceBus

By : David Boike
Book Image

Learning NServiceBus

By: David Boike

Overview of this book

<p>Web service-based systems are designed using Remote Procedure Call (RPC) techniques. This technique is effective; however, this method creates problems with scalability and reusability as fault tolerance is inherently hindered by the RPC principles. This book helps you to overcome this problem by introducing you to the principles of messaging and SOA to build scalable and reliable systems, that are easy to extend and maintain.</p> <p>"Learning NServiceBus" is your essential guide to becoming a messaging guru. The book details the process of building a software system based on the SOA principles. From sending a simple message to publishing events, this book covers everything you need to know to understand and implement an SOA-based message driven systems.</p> <p>"Learning NServiceBus" will teach you how to use publish/subscribe to create an Serivce Oriented Architecture. We will then look how to manage and extend that architecture. Through the course of the book, you will build reliable systems which will automatically compensate for failures. You will also learn to build complex yet testable business processes which will make batch processes seem outdated. By the end of the book, you will realize that SOA is much more than just web services.</p>
Table of Contents (15 chapters)

Dealing with time


Right now you might be saying that we could have implemented what we have so far using a database table for temporary users, and that all we'd need is a cleanup batch job to clear out the users that never follow through. However, to do so would be to miss the great flexibility that sagas offer.

At their core, sagas are entities that contain multiple message handlers with shared state, but they also offer the ability to set a timeout, which is like setting an alarm clock to wake you up at some point in the future. This ensures that the process does not have to stop just because no new messages come in.

But better than just an anonymous alarm clock, we're also able to pass the state into the future, so not only will our saga wake up on command but it will also know why.

In our case, we want two timeouts. When the user first attempts to register, we want a wakeup call two days later, so that we can remind the user to complete the registration, just in case they get busy and forget...