This template helps you implement a Service Broker according to the Open Service Broker API.
It uses the OpenServiceBroker.Server library.
Make sure you have the .NET 8.0 SDK installed your machine. Then install the template by running the following:
dotnet new --install OpenServiceBroker.Template::*
To use the template to create a new project:
dotnet new osb --name MyServiceBroker
cd MyServiceBroker
The startup logic in the template registers the following services for dependency injection:
CatalogService
as an implementation ofICatalogService
.ServiceInstanceService
as an implementation ofIServiceInstanceBlocking
.
CatalogService
reads the list of available services from a static file named catalog.json
.
You can add your services to this file or modify the code to fetch service information from elsewhere.
ServiceInstanceService
stores provisioned services using Entity Framework and SQLite. The relevant data structures are described by DbContext
and ServiceInstanceEntity
.
You will need to add code that does the actual provisioning, optionally replacing the pre-implemented database storage in the process. You can change the service to implement IServiceInstanceDeferred
instead of IServiceBindingBlocking
if your provisioning logic takes more than a few seconds to complete.
You may also wish to add and register an implementation for IServiceBindingBlocking
or IServiceBindingDeferred
See the API documentation for more details.