Book Image

Learning NServiceBus Sagas

By : Richard L Helton
Book Image

Learning NServiceBus Sagas

By: Richard L Helton

Overview of this book

Table of Contents (13 chapters)

Adding NServiceBus to MVC


We will next be extending our BasicPaymentClient folder and projects into a SagaPaymentClient folder and projects with the addition of the bus. The differences will be as follows:

  • We will refactor the WCF client out of the MVC controller and move it into a new message handler.

  • We will create a database that keeps track of the state of the message. The saga data will be saved in the nservicebus table. Ensure that it is created when running the saga code.

  • We will create a new message handler and put the WCF client code in it. This code from the WCF client to the WCF server will be kept separate from the frontend code as far as possible, to keep the PayMessage class completely separate from the frontend.

  • We will create a new message handler in the MVC that will update the DB with the message state as it receives the new state from the endpoints. We will look at the code for the message and saga handlers as we test them in the next section.

  • NServiceBus.Testing offers testing...