1. @Fallback not dependent on remote call, can add fallback on any class
2. @ReyClient, call remote service, if get exception, will respond exception message with
status 222, while actual status in message body
3. If deploy many copies of a set of microservices, how to route to the service?
publicclassFooRouterimplementsGroupRouter{
publicStringreplaceHolder(){
return"#xxx#";
}
publicStringreplaceValue(Objectobj) {
// See the demo: CatServiceGroupRouterForK8S.java// Anyway, coding to ensure all the data only in the dbs connected by the target services// each set of services connect diffent db and cache, one set include: storage, db, cache, // and your program // all in docker, all in k8s, set/k8s namespace
}
}
config:
# when write/read db, sharding db can't support more TPS
# we set the k8s namespace: prod_0, prod_1, prod_2 ....
# k8s ingress to front service(no connection to DB), front service call service-demo
# by this way, one set of services' TPS is 10000, deploy 10 sets, TPS become almost 100000
service.demo=service-demo.prod#xxx#
CODING ERROR
1. annotation Fallback And CircuitBreaker(resilience4j) on the same class:
The Tidelift Subscription provides access to a continuously curated stream of human-researched and maintainer-verified data on open source packages and their licenses, releases, vulnerabilities, and development practices.