<p>When I use RabbitMQ from localhost, I supply my RabbitMQConnectionString as <strong><code>localhost</code></strong> in my ASP.NET Core WebApi and everything works fine.</p>

<p>But I wanted to use RabbitMQ from a Kubernetes Cluster, so, I created a new Namespace in Kubernetes Cluster for RabbitMQ, then I created an app from the Kubernetes Dashboard with the image: <strong><code>rabbitmq:management</code></strong> I specified External Service with Port and target Port as <code>15672</code> for both. And waited for it to be deployed.</p>

<p>I can access the management portal of RabbitMQ with the External IP of service: <strong><code>xx.xx.153.133:15672</code></strong> in the browser, but When I use this IP with port as RabbitMQConnectionString in my ASP.NET Core WebApi, it gives me the following error(through seq):</p>

<p><a href="https://i.stack.imgur.com/F88RM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/F88RM.png" alt="Seq 1"></a></p>

<p>And when I supply IP only i.e. <strong><code>xx.xx.153.133</code></strong>, it searches RabbitMQ on 5672 instead of 15672 and gives me the following error:</p>

<p><a href="https://i.stack.imgur.com/NJ8Od.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NJ8Od.png" alt="Seq 2"></a></p>

<p>Can someone please guide me through on how to proceed and fix the error.</p>

Achal Sharma
<p>I figured it out, I added all 3 ports on Kubernetes now: 15672, 5672, 25672. And used only the IP as the RabbitMQConnectionString. It then automatically uses 5672 port to send &amp; receive messages.</p>
