Address Parsing exception

May 21, 2015 at 9:18 PM
I am just exploring all this and I am not quite sure whether this is a bug or I just don't understand it properly. I am doing/trying to create a simple connection to an eventhub.

private const string AMQPAddress = "amqps://{key-name}:{key}@{namespace-name}.servicebus.windows.net"; // Azure event hub connection string

My key contains a '/' causing the address parse function to throw an exception. I believe when parsing the address the the '/' should be ignored until a '@' is found.. can somebody confirm this?

this goes wrong in when I call the following code snippet (desktop and .NET CF3.9) in the new Address() part.
  // Initialization of AMQP connection to Azure Event Hubs
    private void InitAMQPconnection()
    {
        // Get the Event Hub URI
        ___address = new Address(AMQPAddress);__

        // create connection
        _connection = new Connection(_address);

        // create session
        _session = new Session(_connection);

        // create sender
        _sender = new SenderLink(_session, "send-link", EventHub);
    } 
the reason I am not sure is when I 'fix' this it hangs in the new Connection(). so I never get a connection...

Many thanks for your help,
Coordinator
May 22, 2015 at 1:50 AM
{key-name} and {key} should be URL encoded when you use a connection string to initialize an address object; otherwise this is ambiguity in parsing the string due to optional parts in it.

Regards,
Xin