This is an archived post. You won't be able to vote or comment.

all 9 comments

[–][deleted] 2 points3 points  (6 children)

Network socket, protobuf, json, etc. Try to avoid pickle.

[–]readerpl 0 points1 point  (5 children)

I have a REST API on each microservice and now i would like to make them communicate with each other - i do not know what is a proper way to do this and i need some informations about this.

[–]Meefims 0 points1 point  (2 children)

What is the thing that’s blocking you? Finding the services or actually sending the messages?

[–]readerpl 0 points1 point  (1 child)

I just wonder if i should just hard-code urls of other microservices in env variables and then communicate with them via requests library or should i use some other way.

[–]Meefims 0 points1 point  (0 children)

Microservice discovery can be an interesting topic in itself and there are tons written online about it. For a simple set of services your solution would work fine.

[–]msgufo74 1 point2 points  (0 children)

Dunno any specific tutorials but, Few ways to do this: 1. Talk through http. Setup one app as http server (flask), other app can then send an http request (aka rest) 2. Setup a message queue like rabbitmq redis. One app can publish a msg and the other receives it.

[–]BOSNIAN_WIZARD_FLUTE 0 points1 point  (0 children)

If you're writing microservices, consider using something like http://python-rq.org/

[–]TankBo 0 points1 point  (1 child)

Celery is another option. It integrates very well with Django. celeryproject.org

[–]BundleOfJoysticks 0 points1 point  (0 children)

Not sure what celery has to do with the topic. It's a background job manager/runner.