title: How to access RabbitMQ using servicebusClient?
body: <p>Both RabbitMQ and Servicebus (<a href="https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-amqp-dotnet" rel="nofollow noreferrer">By adding TransportType=Amqp in connectionstring</a>) support AMQP. I am using a ServiceBusClient in my C# c ode, how can I make it connect to my RabbitMQ instead?</p>
  
  <p>So what I have for my service bus is something like this:</p>
  
  <pre><code>    &lt;add key="Microsoft.ServiceBus.ConnectionString"
  value="Endpoint=sb://[namespace].servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=[SAS key];TransportType=Amqp" /&gt;
  </code></pre>
  
  <p>What examples of RabbitMQ show are like this with username and password in place:</p>
  
  <pre><code>"amqp://" amqp_authority [ "/" vhost ] [ "?" query ]
  </code></pre>
  
  <p>How do I convert in connection string? and how do I replace the SharedAccessKey with username and password?</p>
  
  <h2>Note:</h2>
  
  <p>This <a href="https://stackoverflow.com/questions/37001918/can-azure-service-bus-client-connect-to-activemq-amqp-queues">question has been asked before 3 years ago</a>, but since then the framework evolved and as I mentioned is now supporting the AMQP so the answer is not relevant anymore.</p>