When I use RabbitMQ from localhost, I supply my RabbitMQConnectionString as localhost
in my ASP.NET Core WebApi and everything works fine.
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: rabbitmq:management
I specified External Service with Port and target Port as 15672
for both. And waited for it to be deployed.
I can access the management portal of RabbitMQ with the External IP of service: xx.xx.153.133:15672
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):
And when I supply IP only i.e. xx.xx.153.133
, it searches RabbitMQ on 5672 instead of 15672 and gives me the following error:
Can someone please guide me through on how to proceed and fix the error.
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 & receive messages.