MicroServices with Spring: Difference between revisions
From My Limbic Wiki
(→Eureka) |
|||
Line 10: | Line 10: | ||
! scope="col"| Zuul | ! scope="col"| Zuul | ||
! scope="col"| Image | ! scope="col"| Image | ||
! scope=" | |- | ||
! scope="row"| Main | |||
| | |||
* com.microservices.server.EurekaServerApplication.java | |||
@SpringBootApplication | |||
'''@EnableEurekaServer''' // Enable eureka server | |||
| | |||
* com.microservices.zuul.EurekaZuulApplication.java | |||
@SpringBootApplication | |||
'''@EnableEurekaClient''' | |||
'''@EnableZuulProxy''' | |||
| | |||
tofill | |||
|- | |- | ||
! scope="row"| Pom.xml | ! scope="row"| Pom.xml | ||
Line 26: | Line 36: | ||
groupId - fr.dalichamp.microservices.common | groupId - fr.dalichamp.microservices.common | ||
SpringEurekaCommon | SpringEurekaCommon | ||
spring-boot : web, test, devtools & security | spring-boot : web, test, devtools & security | ||
| | | | ||
tofill | |||
|- | |- | ||
! scope="row"| Properties | ! scope="row"| Properties | ||
Line 71: | Line 67: | ||
zuul.routes.auth-service.sensitive-headers=Cookie,Set-Cookie | zuul.routes.auth-service.sensitive-headers=Cookie,Set-Cookie | ||
| | | | ||
tofill | |||
|- | |||
|} | |||
{| class="wikitable" | |||
|- | |||
! scope="col"| Fichiers | |||
! scope="col"| Common | |||
! scope="col"| Auth | |||
|- | |||
! scope="row"| Main | |||
| | |||
* com.microservices. | |||
tofill | |||
| | | | ||
* com.microservices. | |||
tofill | |||
|- | |||
! scope="row"| Pom.xml | |||
| | |||
* Dependencies | |||
tofill | |||
| | | | ||
* Dependencies | |||
tofill | |||
|- | |||
! scope="row"| Properties | |||
| | | | ||
tofill | |||
| | | | ||
tofill | |||
|- | |- | ||
|} | |} |
Revision as of 23:23, 20 September 2019
Vulgarisation
Spécificités dans une Arborescence Spring
Eureka
Is the registration service, all services will connect to the same adress: http://localhost:9000 for example
Fichiers | Server | Zuul | Image |
---|---|---|---|
Main |
@SpringBootApplication @EnableEurekaServer // Enable eureka server |
@SpringBootApplication @EnableEurekaClient @EnableZuulProxy |
tofill |
Pom.xml |
spring-cloud-starter-netflix-eureka-server spring-boot : web, test & devtools |
groupId - org.springframework.cloud spring-cloud-starter-netflix-eureka-client spring-cloud-starter-netflix-zuul groupId - fr.dalichamp.microservices.common SpringEurekaCommon spring-boot : web, test, devtools & security |
tofill |
Properties |
# Name spring.application.name=eureka-server # Default Port server.port=8761 # Eureka server may not be a Client eureka.client.register-with-eureka=false eureka.client.fetch-registry=false |
server.port=8762 spring.application.name=zuul-server eureka.client.service-url.default-zone=http://localhost:8761/eureka/ # A prefix that can added to beginning of all requests. #zuul.prefix=/api # Disable accessing services using service name (i.e. gallery-service). zuul.ignored-services=* # Map paths to services zuul.routes.gallery-service.path=/gallery/** zuul.routes.gallery-service.service-id=gallery-service zuul.routes.auth-service.path=/auth/** zuul.routes.auth-service.service-id=AUTH-SERVICE$ # So, if request is "/gallery/view/1", gallery service will get "/view/1". zuul.routes.auth-service.strip-prefix=false # Exclude authorization from sensitive headers zuul.routes.auth-service.sensitive-headers=Cookie,Set-Cookie |
tofill |
Fichiers | Common | Auth |
---|---|---|
Main |
tofill |
tofill |
Pom.xml |
tofill |
tofill |
Properties |
tofill |
tofill |