programming:spring
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
programming:spring [2024/07/13 19:25] – [Ribbon Client based load balancer] skipidar | programming:spring [2024/07/14 19:36] (current) – [Docker] skipidar | ||
---|---|---|---|
Line 255: | Line 255: | ||
==== Feign - declarative REST client ==== | ==== Feign - declarative REST client ==== | ||
+ | |||
+ | Reduces the glue-code to the minimum. | ||
+ | Need only to express - what to call and receive the response DTO | ||
https:// | https:// | ||
- | {{https:// | ||
+ | <sxh java> | ||
+ | package com.in28minutes.microservices.currencyconversionservice; | ||
+ | import org.springframework.cloud.netflix.feign.FeignClient; | ||
+ | import org.springframework.web.bind.annotation.GetMapping; | ||
+ | import org.springframework.web.bind.annotation.PathVariable; | ||
+ | |||
+ | @FeignClient(name = " | ||
+ | public interface CurrencyExchangeServiceProxy { | ||
+ | |||
+ | @GetMapping("/ | ||
+ | public CurrencyConversionBean retrieveExchangeValue | ||
+ | (@PathVariable(" | ||
+ | } | ||
+ | |||
+ | </ | ||
==== Ribbon - Client based load balancer ==== | ==== Ribbon - Client based load balancer ==== | ||
+ | Exposes multiple deployments under one URL | ||
+ | |||
+ | {{https:// | ||
{{https:// | {{https:// | ||
+ | |||
+ | ==== Zuul API Gateway ==== | ||
+ | |||
+ | API Gateway in SPring | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==== EUreka Namingserver ==== | ||
+ | |||
+ | Allows to register / discover services on a naming server. | ||
+ | |||
+ | Has a GUI to list available services. | ||
+ | |||
+ | {{https:// | ||
+ | |||
+ | |||
+ | |||
+ | ==== Cloud Sleuth - unique tracing id to requests ==== | ||
+ | |||
+ | adds a unique tracing id to requests | ||
+ | |||
+ | |||
+ | |||
+ | ==== Zipkin - Distributed Tracing Server ==== | ||
+ | |||
+ | |||
+ | Central tracing server. | ||
+ | |||
+ | * Like ELK. | ||
+ | * and CloudWatch | ||
+ | |||
+ | |||
+ | {{https:// | ||
+ | {{https:// | ||
+ | ==== Spring Cloud Bus ==== | ||
+ | |||
+ | Can use it to refresh the configs of all services, | ||
+ | by sending a message via the bus. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Docker ===== | ||
+ | |||
+ | == Build manually without gradle == | ||
+ | |||
+ | <sxh java> | ||
+ | docker build --build-arg JAR_FILE=build/ | ||
+ | </ | ||
+ | |||
+ | == Build with Gradle == | ||
+ | |||
+ | You can build a tagged docker image with Gradle in one command: | ||
+ | |||
+ | <sxh java> | ||
+ | sudo su | ||
+ | ./gradlew bootBuildImage --imageName=springio/ | ||
+ | |||
+ | |||
+ | sudo docker images | ||
+ | |||
+ | </ | ||
+ | |||
+ | == And run == | ||
+ | |||
+ | <sxh java> | ||
+ | sudo docker run -p 8080:8080 springio/ | ||
+ | </ |
programming/spring.1720898731.txt.gz · Last modified: by skipidar