rebus-org / Rebus.AzureServiceBus

:bus: Azure Service Bus transport for Rebus
https://mookid.dk/category/rebus
Other
33 stars 20 forks source link

Transport type from connection string is not used with token provider #57

Closed benne closed 3 years ago

benne commented 3 years ago

When using .UseAzureServiceBus(..) or .UseAzureServiceBusAsOneWayClient(..) with an ITokenProvider, the connection string is parsed internally, and parts of it used for sending and receiving in regards to Azure Service Bus.

When the transport is set up without specifying an ITokenProvider, the original connection string makes it all the way to the Service Bus SDK client and it works as expected, but when it is parsed and parts of it used to create the client manually, the transport type option is stripped away, meaning the default transport type of AMQP is always used. So, this problem only appears when used in conjunction with ITokenProvider.

Example of a connection string; Endpoint=sb://test.servicebus.windows.net/;SharedAccessKeyName=Root..;SharedAccessKey=XYoXQ...;TransportType=AmqpWebSockets