How to deploy a nameko microservice

127 Views Asked by At

I've been reading through the nameko docs, and it is all good and clear, except for one part. How do you actually deploy your nameko microservice? I mean, it is clear how we deploy RESTful APIs in flask_restful, for instance. But with nameko? If two microservices should communicate, how do we move them into the "listening" state?

1

There are 1 best solutions below

0
On

I am not sure I understand your problem. For each nameko service you define AMQP_URI constant that point to your RabbitMQ instance. If each of your services have the same AMQP_URI, it make possible communication through sending rpc calls (where you have a queue per service endpoint) or using pub/sub messaging because service use the same RabbitMQ instance.

You can also have HTTP REST API. You must define endpoint in nameko service with http decorator (see example here: https://nameko.readthedocs.io/en/stable/built_in_extensions.html). In your confguration you have to define PORT for you web server, e.g. port 8000: WEB_SERVER_ADDRESS: 0.0.0.0:8000. And make this port accessible for the World.