Skip to content

Conversation

@danielmarbach
Copy link
Contributor

@danielmarbach danielmarbach commented Nov 4, 2025

Generally it is not recommended to use features within the transport seam, but Azure Service Bus currently requires it to propagate earlier the transport transaction in cases when the native outgoing message customizers are used on top of SendOptions, PublishOptions or ReplyOptions.

We have attempted some spiking around introducing a more explicit way to bring context into the dispatched transport operations, but it would require some breaking changes to the properties of the transport operations, which may also affect outbox transport operations.

This non-breaking change moves the UseTransport method from the endpoint configuration to an extension method similar to how UsePersistence and UseSerializer already work. By having it in an extension method, downstream transports can add more specific APIs when needed, which allows them to gain access to the endpoint configuration when the transport is used in non-raw modes. An example with Azure Service Bus

    public static RoutingSettings<AzureServiceBusTransport> UseTransport(this EndpointConfiguration endpointConfiguration, AzureServiceBusTransport transport)
    {
        endpointConfiguration.EnableFeature<NativeMessageCustomizationFeature>();
        return endpointConfiguration.UseTransport<AzureServiceBusTransport>(transport);
    }

This approach makes it apparent when the features will be active and when they won't be, and access to features within the transport is slightly more involved (since it should only ever be done when needed).

It will still fail when an extension method doesn't end with a period or is empty
@danielmarbach danielmarbach merged commit 840f3c7 into master Nov 4, 2025
4 checks passed
@danielmarbach danielmarbach deleted the use-transport branch November 4, 2025 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants