Learning NServiceBus - Second Edition
eBook - ePub

Learning NServiceBus - Second Edition

David Boike

Share book
  1. 204 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Learning NServiceBus - Second Edition

David Boike

Book details
Book preview
Table of contents
Citations

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Learning NServiceBus - Second Edition an online PDF/ePUB?
Yes, you can access Learning NServiceBus - Second Edition by David Boike in PDF and/or ePUB format, as well as other popular books in Computer Science & Entreprise Applications. We have over one million books available in our catalogue for you to explore.

Information

Learning NServiceBus Second Edition


Table of Contents

Learning NServiceBus Second Edition
Credits
Foreword
Early influences
Starting with MSMQ
What open source meant in those days
Clouds on the horizon
Unexpected success
Fast-forward to today
Back to David, and this book
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Instant updates on new Packt books
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting on the IBus
Why use NServiceBus?
Getting the code
NServiceBus NuGet packages
Our first example
Creating a message assembly
Creating a service endpoint
Creating a message handler
Sending a message from an MVC application
Creating the MVC website
Running the solution
Summary
2. Messaging Patterns
Commands versus events
Eventual consistency
Achieving consistency with messaging
Events
Publishing an event
Subscribing to an event
Message routing
Summary
3. Preparing for Failure
Fault tolerance and transactional processing
Error queues and replay
Automatic retries
Replaying errors
Second-level retries
RetryDemo
Messages that expire
Auditing messages
Web service integration and idempotence
Summary
4. Hosting
Hosting types
NServiceBus-hosted endpoints
Self-hosted endpoints
Assembly scanning
Choosing an endpoint name
Dependency injection
Message transport
Reasons to use a different transport
MSMQ
RabbitMQ
SQL Server
Windows Azure
Persistence
In-memory persistence
NHibernate
RavenDB
Windows Azure
Polyglot persistence
Message serialization
Transactions
Purging the queue on startup
Installers
Startup
Send-only endpoints
Summary
5. Advanced Messaging
Unobtrusive mode
TimeToBeReceived attribute
Message versioning
Polymorphic dispatch
Events as interfaces
Specifying the handler order
Message actions
Stopping a message
Deferring a message
Forwarding messages
Message headers
Property encryption
Transporting large payloads
Exposing web services
Summary
6. Sagas
Long-running processes
Defining a saga
Finding saga data
Ending a saga
Dealing with time
Design guidelines
Business logic only
Saga lifetime
Saga patterns
Messages that start sagas
Retraining business stakeholders
Persistence concerns
RavenDB
NHibernate
Azure
Unit testing
Testing events as interfaces
Scheduling
Summary
7. Advanced Configuration
Extending NServiceBus
IConfigureThisEndpoint
INeedInitialization
IWantToRunWhenBusStartsAndStops
Dependency injection
Unit of work
Message mutators
The NServiceBus pipeline
Building behaviors
Ordering behaviors
Replacing behaviors
The pipeline context
Outbox
DTC 101
Life without distributed transactions
Outbox configuration
Session sharing
Summary
8. The Service Platform
ServiceControl
ServiceInsight
Endpoint Explorer
Messages
Main view
Flow Diagram
Saga
Sequence Diagram
Other tabs
ServicePulse
Endpoint activity
Failed messages
Custom checks
Getting notified
ServiceMatrix
Summary
9. Administration
Service installation
Infrastructure installers
Side-by-side installation
Profiles
Environmental profiles
Feature profiles
Customizing profiles
Logging profiles
Customizing the log level
Managing configurations
Monitoring performance
Scalability
Scaling up
Scaling out
Decommissioning a MSMQ worker
Extreme scale
Multiple sites
Virtualization
MSMQ message storage
Clustering
Transport administration
Summary
10. Where to Go from Here?
What we've learned
What next?
Index

Learning NServiceBus Second Edition

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: August 2013
Second edition: January 2015
Production reference: 1250115
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78439-292-5
www.packtpub.com

Credits

Author
David Boike
Reviewers
Prashant Brall
Roy Cornelissen
Hadi Eskandari
Daniel Marbach
Commissioning Editor
Dipika Gaonkar
Acquisition Editor
Larissa Pinto
Content Development Editor
Kirti Patil
Technical Editor
Chinmay S. Puranik
Copy Editors
Dipti Kapadia
Vikrant Phadke
Project Coordinator
Kranti Berde
Proofreaders
Simran Bhogal
Maria Gould
Ameesha Green
Bernadette Watkins
Indexer
Monica Ajmera Mehta
Graphics
Sheetal Aute
Abhinash Sahu
Production Coordinators
Arvindkumar Gupta
Nilesh R. Mohite
Cover Work
Arvindkumar Gupta
Nilesh R. Mohite

Foreword

Unlike many people who write a foreword for a book, I have myself not actually written a book yet, so I am probably going about this the wrong way. Also, of all the books that I have read, I have almost never read the foreword, which makes me wonder who is actually reading this.
That being said, I think that 10 years of blogging has actually prepared me very well to write this foreword, and it will end up being roughly as long as my regular blog posts.
In any case, I am extremely happy to see how well the first edition of this Learning NServiceBus book has done, and when David asked me to write the foreword for this second edition, I was more than willing to oblige.
Now that you've picked up this book, I think it's fair to assume that you have heard something about NServiceBus, maybe even downloaded it, played with it, or used it on a project or two. What you might not know is the story of how it all began and how we ended up where we are today—seeing the second edition of Learning NServiceBus being published.

Early influences

Almost 15 years ago, I was working as a developer on a gigantic command and control system developed in a language called Ada. This is what Wikipedia has to say about Ada:
"[Ada] has built-in language support for explicit concurrency, offering tasks, synchronous message passing, protected objects, and non-determinism."
These were very important attributes for a system that needed to be super reliable, highly performant, and very scalable. Little did I realize at that time how profound an effect this relatively unknown programming language would have on the rest of my career.
In my next company, a software development firm—the kind that does turnkey projects for its customers—I continued my focus on command and control systems, this time using the fairly new .NET platform from Microsoft. The thing was that many of the abilities that I'd come to rely on in Ada were (to me) curiously absent from .NET.
Like any good craftsman who has gotten used to a certain tool, I started looking around for a replacement, and when I couldn't find one, I went and made it myself.

Starting with MSMQ

Although the main message from Microsoft at the time was all about XML Web Services an...

Table of contents