@RestController
class ThisWillActuallyRun {
@RequestMapping("/")
String home() {
Hello World!
}
}
Spencer Gibb,
@spencerbgibb,
sgibb@pivotal.io
Dave Syer,
@david_syer,
dsyer@pivotal.io
It needs to be super easy to implement and update a service:
@RestController
class ThisWillActuallyRun {
@RequestMapping("/")
String home() {
Hello World!
}
}
and you don’t get much more "micro" than that.
Deploying services needs to be simple and reproducible
$ cf push app -p app.groovy
and you don’t get much more convenient than that.
(Same argument for other PaaS solutions)
It’s excellent to be able to implement a microservice really easily (Spring Boot), but building a system that way surfaces "non-functional" requirements that you otherwise didn’t have.
There are laws of physics that make some problems unsolvable (consistency, latency), but brittleness and manageability can be addressed with generic, boiler plate patterns.
Coordination of distributed systems leads to boiler plate patterns
Release It!: https://pragprog.com/book/mnee/release-it
@HystrixCommand(fallbackMethod="getDefaultMessage")
public String getMessage() {
return restTemplate.getForObject(/*...*/);
}
public String getDefaultMessage() {
return "Hello World Default";
}
// somewhere else
helloService.getMessage();
/metrics
/hystrix.stream
@EnableHystrixDashboard
zuul.proxy.route.customers: /customers
Hystrix→Ribbon→Eureka
to forward requests to appropriate service@EnableZuulProxy
@Controller
class Application {
}
@EnableSidecar
As a microservice developer, I want to write code and run it locally, but have a hight confidence that it will work in the target system.
/