Communication between microservices - request data

后端 未结 3 1119
余生分开走
余生分开走 2021-02-13 21:37

I am dealing with communication between microservices.

For example (fictive example, just for the illustration):

  • Microservice A - Store Us
3条回答
  •  既然无缘
    2021-02-13 22:13

    In your case using direct REST calls should be fine.

    Option 1 Use Rest API :

    When you need synchronous communication. For example, your case. This option is suitable.

    Option 2 Use AMQP :

    When you need asynchronous communication. For example when your order service creates order you may want to notify product service to reduce the product quantity. Or you may want to nofity user service that order for user is successfully placed.

    I highly recommend having a look at http://microservices.io/patterns/index.html

提交回复
热议问题