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

Profiles


In a lot of software systems, you'll either see a litany of different settings in a configuration file, or a single configuration value and a huge wall of settings in a switch statement in code. This is not so with NServiceBus. NServiceBus uses a concept called a profile to activate different options within an endpoint based on environment or capability.

Tip

Many of the dependency injection containers support a feature similar to profiles. If you are using a custom DI container, it may be a better idea to rely on your container's features for use with your own code. The exception where you must use NServiceBus profiles is when you are registering custom code to be used by NServiceBus itself.

A profile can be activated on an endpoint by including its full class name as a command-line parameter, or by including it with the installation options when installing an endpoint as a service. For instance, to run an endpoint with the Lite profile, run the following code:

> NServiceBus.Host...