Azure Service Bus Transport Upgrade Version 7 to 8

Forwarding Topology number of entities in bundle removed

In Versions 8 and above the API to configure bundle prefix and number of entities in a bundle has been removed:

7.x - 7.2.3 NServiceBus.Azure.Transports.WindowsAzureServiceBus
var transport = endpointConfiguration.UseTransport<AzureServiceBusTransport>();
var forwardingTopology = transport.UseForwardingTopology();

forwardingTopology.BundlePrefix("my-prefix");
forwardingTopology.NumberOfEntitiesInBundle(3);

The bundle is set to one entity. For existing endpoints running with multiple entities in a bundle, the transport automatically picks up previously configured entities. The default topic name for bundle is set to bundle-1.

See also Azure Service Bus Transport Topologies.

BrokeredMessage conventions

API to specify how the BrokeredMessage body is stored and retrieved by overriding the default conventions is obsoleted and the following methods were deprecated:

7.x NServiceBus.Azure.Transports.WindowsAzureServiceBus
var transport = endpointConfiguration.UseTransport<AzureServiceBusTransport>();

transport.BrokeredMessageBodyType(SupportedBrokeredMessageBodyTypes.Stream);
// OR
transport.UseBrokeredMessageToIncomingMessageConverter<CustomIncomingMessageConversion>();
6.3 NServiceBus.Azure.Transports.WindowsAzureServiceBus
BrokeredMessageBodyConversion.ExtractBody =
    brokeredMessage =>
    {
        using (var stream = new MemoryStream())
        using (var body = brokeredMessage.GetBody<Stream>())
        {
            body.CopyTo(stream);
            return stream.ToArray();
        }
    };
7.x NServiceBus.Azure.Transports.WindowsAzureServiceBus
var transport = endpointConfiguration.UseTransport<AzureServiceBusTransport>();

transport.BrokeredMessageBodyType(SupportedBrokeredMessageBodyTypes.Stream);
// OR
transport.UseOutgoingMessageToBrokeredMessageConverter<CustomOutgoingMessageConversion>();
6.3 NServiceBus.Azure.Transports.WindowsAzureServiceBus
BrokeredMessageBodyConversion.InjectBody =
    bytes =>
    {
        var messageAsStream = new MemoryStream(bytes);
        return new BrokeredMessage(messageAsStream);
    };

Related Articles


Last modified