0
votes

I'm currently investigating Windows Service Bus for my work and have managed to get a test system up using NetMessaging as the transport type very quickly. However, today I tried to switch to AMQP as the transport mechanism and I just can't seem to get it work - it successfully creates a MessagingFactory based on my connection string but fails when I try to create a queue, giving me the error:

The token provider was unable to provide a security token while accessing 'https://{local machine name}:5671/TestServiceBus/$STS/Windows/'. Token provider returned message: 'The underlying connection was closed: The connection was closed unexpectedly.'

I've consulted the documentation but can't see what I've done wrong. I think I might have got the connection string wrong, I essentially took the default one you get from the powershell command (get-SBClientConfiguration) and modified the ports. I also took the example connection string from here: http://azure.microsoft.com/en-gb/documentation/articles/service-bus-dotnet-advanced-message-queuing/

and modified it appropriately, so it looked something like this:

Endpoint=sb://{local machine name}/TestServiceBus;RuntimePort=5672;ManagementPort=5671;SharedSecretIssuer={issuer name};SharedSecretValue={private key};TransportType=Amqp

However, because that article relates directly to Azure, I didn't have the SharedAccessKeyName or the SharedSecretValue properties that seem to come from the Azure dashboard, so instead I used the IssuerName and primary key values from get-SBClientConfiguration, but that doesn't work either.

I'd appreciate any help with this because it's driving me mad!

Thanks

2

2 Answers

2
votes

It turns out that I had the connection string incorrect, AMQP essentially uses the same connection string as NetMessaging with the exception of the runtime port and the TransportType.

So our NetMessaging conn string looks like this:

Endpoint=sb://<machine name>/TestServiceBus;StsEndpoint=https://<machine name>:9355/TestServiceBus;RuntimePort=9354;ManagementPort=9355

And the AMQP one looks like this:

Endpoint=sb://<machine name>/TestServiceBus;StsEndpoint=https://<machine name>:9355/TestServiceBus;RuntimePort=5671;ManagementPort=9355;TransportType=Amqp

Note that the port numbers in this case are the default ones set up by the Service Bus config process.

-1
votes

When using Servicebus for Windows Server, we are using username/password in our connection string.