programming:spring
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| programming:spring [2023/11/01 07:31] – ↷ Page moved from camunda:programming:spring to programming:spring skipidar | programming:spring [2024/07/14 19:36] (current) – [Docker] skipidar | ||
|---|---|---|---|
| Line 226: | Line 226: | ||
| and they will be mapped to queries. | and they will be mapped to queries. | ||
| + | |||
| + | ===== API Versioning ==== | ||
| + | |||
| + | URI Versioning - Twitter | ||
| + | * http:// | ||
| + | * http:// | ||
| + | |||
| + | |||
| + | Request Parameter versioning - Amazon | ||
| + | * http:// | ||
| + | * http:// | ||
| + | |||
| + | |||
| + | (Custom) headers versioning - Microsoft | ||
| + | * SAME-URL headers=(X-API-VERSION=l] | ||
| + | * SAME-URL headers=[X-API-VERSION=2] | ||
| + | |||
| + | |||
| + | Media type versioning - GitHub | ||
| + | * SAME-URL produces=application/ | ||
| + | * SAME-URL produces=application/ | ||
| + | |||
| + | |||
| + | ===== Libs ===== | ||
| + | |||
| + | ==== Hystrix - Circuit Breaker ==== | ||
| + | https:// | ||
| + | |||
| + | ==== Feign - declarative REST client ==== | ||
| + | |||
| + | Reduces the glue-code to the minimum. | ||
| + | Need only to express - what to call and receive the response DTO | ||
| + | |||
| + | 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 ==== | ||
| + | |||
| + | Exposes multiple deployments under one URL | ||
| + | |||
| + | {{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.1698823899.txt.gz · Last modified: by skipidar
