Skip to main content
.NETStandard2.1

Package Description

NuGetCompare
Published
Nov 19, 2025
11mo ago
Total Downloads
14.0K
14,015

Install

dotnet add package JustSaying.Naming.EnvironmentServiceNaming --version 8.1.9-pre.2
ProductVersions
.NET Standard
netstandard2.1

README

EnvironmentServiceNaming

This is a page for JustSaying v7 to add a naming convention based on environment & service name. It also has an extra method for defining point to point queues.

What it looks like

Environment and service name are converted to lower case and any non-alphanumeric characters are removed.

Topic queues:

{environment}-{service}-{messageType}

Topic name:

{environment}-{messageType}

Point to point queues:

{environment}-p2p-{messageType}

How to use

Set up default naming conventions

This will set up the default naming conventions for all queues and topics.

var environment = "test";
var serviceName = "my-service";

var namingStrategy = new EnvironmentNamingStrategy(environment, serviceName);

container.RegisterInstance<IQueueNamingConvention>(queueNamingConvention);
container.RegisterInstance<ITopicNamingConvention>(topicNamingConvention);

var builder = new MessagingBusBuilder()
    // Other configuration here
    .Messaging(
        x =>
        {
            // Other configuration here
            x.WithQueueNamingConvention(queueNamingConvention);
            x.WithTopicNamingConvention(topicNamingConvention);
        });

To use the point to point naming convention, the subscription / publisher needs to be setup during configuration:

    builder.Subscriptions(
        x =>
        {
           
            x.ForQueue<TestMessagePointToPoint>(
                cfg =>
                {
                    cfg.ConfigurePointToPointQueue(Environment);
                });
        }
    );
    
     builder.Publications(
        x =>
        {
            x.WithQueue<TestMessagePointToPoint>(cfg => cfg.ConfigurePointToPointPublisher(Environment));
        });

If individual p2p queues aren't configured as above, then it will default to:

{environment}-{service}-{messageType}

Additional Notes

There are helper extension methods for configuration which are used above:

ConfigurePointToPointPublisher ConfigurePointToPointQueue

In a similar vein exists ConfigureTopic which provides a similar interface for configuring subscriptions, but is not strictly needed for configuring naming conventions.

Changes from Previous Version

No structural changes between v7.1.2-pre.1 and v8.1.9-pre.2.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

This version is marked prerelease. Validate its API and upgrade path before production use.No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.