Book Image

Learning NServiceBus - Second Edition

By : David Boike
Book Image

Learning NServiceBus - Second Edition

By: David Boike

Overview of this book

Table of Contents (18 chapters)
Learning NServiceBus Second Edition
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Persistence


Like most applications, every now and then, NServiceBus has the need to store some data, but unlike most applications, NServiceBus does this in a completely configurable way. You can choose to use one of the official persistence libraries according to your organization's needs, or you can choose to write your own.

NServiceBus uses persistence to store subscriptions for transports that use storage-based publishing, as we have already seen. It also stores saga and timeout data, which we will learn about in Chapter 6, Sagas. Persistence is also used by the Gateway, which we will learn about in Chapter 9, Administration, and by the Outbox feature, which we will learn about in Chapter 7, Advanced Configuration.

A persistence mechanism is defined by a class inheriting NServiceBus.Persistence.PersistenceDefinition, which is inserted into the cfg.UsePersistence<T>() method, which we have already seen. The supported mechanisms available from Particular are InMemoryPersistence, NHibernatePersistence...