Spring Boot - how to communicate between microservices?

后端 未结 6 2069
逝去的感伤
逝去的感伤 2021-02-07 15:59

I\'m currently working on a Spring Boot microservices project. I have created services and each service is running separately. With this, I need some services to communicate wit

6条回答
  •  既然无缘
    2021-02-07 16:28

    Although REST is familiar and therefore easy to implement, if you need more flexible and Java-like communications, Spring's (Spring-to-Spring) HTTP Invoker may be a good choice.

    Spring's HTTP invoker is a good choice if you need HTTP-based remoting but also rely on Java serialization. It shares the basic infrastructure with RMI invokers, just using HTTP as transport. Note that HTTP invokers are not only limited to Java-to-Java remoting but also to Spring on both the client and server side. (The latter also applies to Spring's RMI invoker for non-RMI interfaces.)

    • https://docs.spring.io/spring/docs/2.5.x/reference/remoting.html
    • https://www.baeldung.com/spring-remoting-http-invoker

提交回复
热议问题