SpringCloud study notes among ---- Feign component calls

Feign's main role is to make calls between components of micro-services more convenient. Only a small amount of configuration, you can complete calls between components.

Feign Configuration

Add Feign dependence:

Feign module to create, modify application.properties configuration file:

Start classes with the @EnableFeignClients (basePackages = { "com.jx"}) named cross-component method call position.

In addition several new methods TestController EurekaClient1 follows:

Wherein the user class is:

Then add the call interface in Feign:

Create a call interface TestController:

Then start the project, visit HTTP: // localhost: 8040 / the Hello :

Access: HTTP: // localhost: 8040 / feignTest

At this point, the module calls between feign complete.

SpringCloud There are some other modules, such as ribbon achieve load balancing, Hystrix disaster recovery demotion. After a time to add it.

SpringCloudDemo: https://download.csdn.net/download/sklaaaa/12233091 (resources may review, please try again later)

Disclaimer: This article is a blogger original article, reproduced, please attach the original source link and this statement.

Released four original articles · won praise 0 · Views 125

Guess you like

Origin blog.csdn.net/sklaaaa/article/details/104713817