anchor.diff:  * Fallback - If the downstream service is sinking and we fail fast, let's give our end users something a bit better than a stacktrace.
   --
   
  +// ----------------------------------------------------------------------------
  +
  +=== Eureka Server
  +
  +* `@EnableEurekaServer`
  +* Dependency to `cloud-starter-eureka-server`
  +
  +[source, java]
  +----
  +@EnableEurekaServer
  +@EnableAutoConfiguration
  +public class EurekaApplication {
  +  public static void main(String[] args) {
  +    SpringApplication.run(EurekaApplication.class, args);
  +  }
  +}
  +----
  +
  +// ----------------------------------------------------------------------------
  +
  +=== Eureka Client
  +
  +* Registers automatically with the Eureka server under a defined name
  +* Can access other Microservices
  +* Integrates Load Balancing with Ribbon using
  +** `DiscoveryClient`, `FeignClient`
  +** Eureka aware `RestTemplate` (sample later)
  +* `@EnableDiscoveryClient` or `@EnableEurekaClient`
  +* Dependency to `spring-cloud-starter-eureka`
  +
  +[source]
  +----
  +eureka.client.serviceUrl.defaultZone=http://eureka:8761/eureka/
  +eureka.instance.leaseRenewalIntervalInSeconds=5
  +spring.application.name=catalog
  +eureka.instance.metadataMap.instanceId=ipservice:${random.value}
  +eureka.instance.preferIpAddress=true
  +----
  +
  +// ----------------------------------------------------------------------------
  +
  +=== `RestTemplate` & Load Balancing
  +
  +* `@RibbonClient`
  +* Dependency to `spring-cloud-starter-ribbon`
  +
  +[source, java]
  +----
  +@RibbonClient("ipclient")
  +... // Left out other Spring Cloud / Boot Annotations
  +public class IPAddressController {
  +
  +  @Autowired
  +  private RestTemplate restTemplate;
  +
  +  @RequestMapping(value = "/ip", method = RequestMethod.GET)
  +  public IPAddress ipaddress() throws Exception {
  +    return template.getForEntity("http://ipservice/ip", IPAddress.class).getBody();
  +  }
  +}
  +----
  +
  +// ----------------------------------------------------------------------------
  +
  +=== Hystrix with Annotations
  +
  +* Java proxies automaticaly created
  +* Annotations of _javanica_ library
  +* `@EnableCircuitBreaker` or `@EnableHystrix`, dependency to `spring-cloud-starter-hystrix`
  +
  +[source, java]
  +----
  +@RequestMapping(value = "/ip", method = RequestMethod.GET)
  +@HystrixCommand(fallbackMethod = "localIP")
  +public IPAddress ipaddress() throws Exception {
  +    return template.getForEntity("http://ipservice/ip", IPAddress.class).getBody();
  +}
  +
  +public IPAddress localIP() throws UnknownHostException {
  +    return new IPAddress(++counter, InetAddress.getLocalHost().getHostAddress(),
  +        config.getMessage());
  +}
  +----
   
   // ----------------------------------------------------------------------------
   
  
positive.code: 
  // ----------------------------------------------------------------------------
  
  == Typical problems developing microservices
  
  * How to run them all locally? => Minikube, Minishift, CDK
  
negative.code: --
  
  [.event]
  Capgemini Open Day +
  Poznań, 13th of June 2017
  
  [.newline]
  {speaker}
  