2

I am working on one green field project using of containerized(Docker) Micro Service Architecture and each Micro Service is host in Kubernetes. Sometimes, Based on the requirement, Need to communicate one service(MicroService_2) to another service(MicroService_1) using RabbitMQ.

Below image describes that how my project architecture looks and communicate.

enter image description here

When all services are hosted in Kubernetes at that time I am facing below error.

MassTransit.EndpointNotFoundException : The host was not found for the specified address: rabbitmq://localhost:31001/Service_2 (This is MessageBus URL)

But If I deleted these services (Microservice_1 & MicroService_2) from Kubernetes and run locally then its working fine.

Is there any different URL of MessageBus when we deploy the services into Kubernetes?

Dipak Delvadiya
  • 2,112
  • 2
  • 19
  • 33
  • It's almost certainly not `localhost`, yes. – David Maze Nov 02 '18 at 10:49
  • can you please provide information on your cluster? What tool did you use for deploying the cluster, or maybe it is a cloud provider? Also `kubectl get pods --all-namespaces` while the pods are running could be helpfull. – aurelius Nov 02 '18 at 17:22
  • @DavidMaze I got the solution and root cause is port listening, When service running in Kubernetes at that time it listening the external port and when its locally then listening the internal port. In my case external port is 5672 and internal is 31001. I connect the queue using rabbitmq://localhost:31001/centres(queueName) – Dipak Delvadiya Nov 06 '18 at 08:34

0 Answers0