O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Learning NServiceBus Sagas

Book Description

Discover how to design, build, and test sagas and messaging with NServiceBus

In Detail

NServiceBus (NSB) is the most popular Enterprise Service Bus (ESB) for C#. This learning guide will equip you with the skills to develop and design NSB sagas and NSB messaging. The first few chapters will discuss the basics of SOA, gradually leading you into the detailed topics of NSB.

In the next chapters, NSB platform services will be covered for monitoring, designing in Visual Studio, and operational pulses on NSB. Many example architectures will be explained using ASP.NET Model-View-Controllers, Entity Frameworks, NHibernate, MSMQ, RabbitMQ, SQL Server queues, ActiveMQ, and MongoDB. Finally, endpoints will be extended using sagas to integrate them into secure protocols such as Secure File Transfer Protocol (SFTP) and C# web services.

By the end of this book, you will be able to design, build, and test NServiceBus sagas and perform message handling.

What You Will Learn

  • Design, develop, monitor, and test messaging and sagas using NSB platform tools
  • Familiarize yourself with the architecture of NSB from a conceptual aspect
  • Decouple ASP.NET frontend to backend services through messaging using design patterns in NSB
  • Get to grips with saga properties and its work flow
  • Integrate endpoints into web services
  • Understand the basics of IBus and configure it
  • Configure, code, and deploy NServiceBus frameworks and APIs in Visual Studio
  • Combine NSB with non-C# solutions such as cloud-based solutions

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Learning NServiceBus Sagas
    1. Table of Contents
    2. Learning NServiceBus Sagas
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Introduction to Sagas
      1. A brief introduction to ESBs
        1. Event-driven jobs
        2. Additional SOA patterns
        3. The publish-subscribe pattern
        4. The request-reply pattern
        5. The gateway pattern
          1. The source code
        6. The DataBus pattern
        7. Timeout patterns
        8. Message mutation patterns
          1. The source code
        9. Message encryption patterns
          1. The source code
        10. The ScaleOut pattern
        11. The saga design pattern
      2. Sagas – what are they good for?
      3. Summary
    9. 2. NServiceBus Saga Architecture
      1. Upgrading from NSB version 4 to 5
      2. The saga workflow
        1. Message flow
      3. Deployment
      4. ServiceInsight
      5. Summary
    10. 3. The Particular Service Platform
      1. Introducing NSB components
      2. Understanding ServicePulse and its function
        1. Understanding ServiceControl and its function
      3. Understanding ServiceInsight and its function
        1. Creating a ServiceMatrix solution
        2. Sagas through ServiceMatrix
      4. Introducing CustomChecks for ServicePulse
      5. Summary
    11. 4. Saga Development
      1. A brief overview of ASP.NET MVC
      2. Sagas and web services
        1. The source code
      3. Creating a WCF server
        1. Adding messages
        2. Adding the message handler
        3. Adding the configuration
        4. Adding tracing
        5. Viewing the web service
          1. Considerations when deploying
      4. Creating a WCF client
        1. Adding the service reference
          1. Calling the service reference
        2. Revisiting the design
          1. The source code
      5. Adding NServiceBus to MVC
        1. Message handler unit testing
        2. Saga handler unit testing
        3. Integration tests with MVC
      6. RabbitMQ for NSB
        1. The source code
        2. Changing the endpoints
      7. ActiveMQ in NSB
        1. The source code
      8. Summary
    12. 5. Saga Snippets
      1. Source code overview
      2. Sample e-mail saga notification
        1. Using XAML
        2. The saga project
        3. Testing the solution
      3. Sample SFTP saga
        1. Using XAML
        2. Changing the process of messaging
        3. Setting up an SFTP test environment
      4. Saga deployment
      5. ActiveMQ
        1. The source code
      6. Summary
    13. 6. Using NServiceBus in the Cloud
      1. Introducing the cloud and NSB
      2. Introducing PaaS, IaaS, and SaaS
      3. Using Microsoft Azure
        1. Introducing Azure Storage Services
        2. Azure Service Bus and Storage Queues
        3. Azure Storage Queues and NSB
        4. Azure Service Bus in NSB
      4. Summary
    14. Index