Book Image

MASTERING NSERVICEBUS AND PERSISTENCE

By : Richard L Helton
Book Image

MASTERING NSERVICEBUS AND PERSISTENCE

By: Richard L Helton

Overview of this book

Table of Contents (15 chapters)
Mastering NServiceBus and Persistence
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Sagas through ServiceMatrix


Not only can we develop endpoints for command and publish/subscribe messages, but we can also develop sagas in ServiceMatrix. We will start by creating a new command message, PaymentNotification.

The copy preview box will appear again as we copy the sending of the new command message to the message handler:

  public partial class PaymentAcceptedHandler
    {

        partial void HandleImplementation(PaymentAccepted message)
        {
            // TODO: PaymentAcceptedHandler: Add code to handle the PaymentAccepted message.
            Console.WriteLine("Paying received " + message.GetType().Name);
            var paymentNotification = new PaymentEngine.Internal.Commands.Paying.PaymentNotification();
            Bus.Send(paymentNotification);
        }
    }

We will deploy the receiving endpoint on to a new endpoint called NotifyProcessing.

This is what we should have so far:

To start the saga process, we need to click on Reply with Message....

This will allow us...