Skip to content

Add a project template for a conventions assembly #540

@DavidBoike

Description

@DavidBoike

Describe the feature.

There is a lot of code that's common to all endpoints in an NServiceBus system, and this code shouldn't be duplicated across all endpoints.

As an example, in the AWS Loan Broker Showcase, the CommonConfigurations project collapses everything down to a single extension method.

A template could provide sensible defaults with selectable transport and persistence, similar to the existing endpoint template, and then allow system architects to further customize it.

That means that individual endpoints can have ultra-simple Program.cs files such as:

using CommonConfigurations;
using Microsoft.Extensions.Hosting;

Host.CreateApplicationBuilder(args)
    .ConfigureAwsNServiceBusEndpoint("Bank2Adapter")
    .Build()
    .Run();

Even when routing information must be provided…

using CommonConfigurations;
using LoanBroker;
using LoanBroker.Messages;
using Microsoft.Extensions.Hosting;

Host.CreateApplicationBuilder(args)
    .ConfigureServices()
    .ConfigureAwsNServiceBusEndpoint("LoanBroker", c => c.Routing.RouteToEndpoint(typeof(FindBestLoanWithScore), "LoanBroker"))
    .Build()
    .Run();

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions