RabbitMQ Transport Upgrade Version 4 to 5

Component: RabbitMQ Transport
This page targets a pre-release version and is subject to change prior to the final release.

Mandatory topology selection.

Specifying a routing topology is now mandatory. For backwards compatiblility, the recommendation is to use the ConventionalRoutingTopology which was the previous default.

See the transport configuration documentation for further details.

ConnectionStringName

ConnectionStringName has been deprecated and can be replaced with a combination of ConfigurationManager.ConnectionStrings and setting via code

5-pre NServiceBus.RabbitMQ
var transport = endpointConfiguration.UseTransport<RabbitMQTransport>();
var connectionSettings = ConfigurationManager.ConnectionStrings["MyConnectionStringName"];
transport.ConnectionString(connectionSettings.ConnectionString);
4.x NServiceBus.RabbitMQ
var transport = endpointConfiguration.UseTransport<RabbitMQTransport>();
transport.ConnectionStringName("MyConnectionStringName");

UseDirectRoutingTopology convention changes

When using UseDirectRoutingTopology the address and the event Type are no longer passed to exchangeNameConvention.

5-pre NServiceBus.RabbitMQ
var transport = endpointConfiguration.UseTransport<RabbitMQTransport>();
transport.UseDirectRoutingTopology(
    routingKeyConvention: type => "myroutingkey",
    exchangeNameConvention: () => "MyTopic");
4.x NServiceBus.RabbitMQ
var transport = endpointConfiguration.UseTransport<RabbitMQTransport>();
transport.UseDirectRoutingTopology(
    routingKeyConvention: type => "myroutingkey",
    exchangeNameConvention: (address, eventType) => "MyTopic");

Members added to IRoutingTopology

Members have changed in IRoutingTopology:

  • Initialize has had extra parameters added.
  • BindToDelayInfrastructure method has been added.

See custom routing topology for updated implementation instructions.

Related Articles


Last modified