Diese Präsentation wurde erfolgreich gemeldet.
Die SlideShare-Präsentation wird heruntergeladen. ×

Implementing Resilience with Micronaut

Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Wird geladen in …3
×

Hier ansehen

1 von 20 Anzeige

Implementing Resilience with Micronaut

Herunterladen, um offline zu lesen

Slides from my demonstration of implementing resilience with micronaut framework. The patterns included in the demo consists of the timeout, retry, circuit breaker, and fallback.

Slides from my demonstration of implementing resilience with micronaut framework. The patterns included in the demo consists of the timeout, retry, circuit breaker, and fallback.

Anzeige
Anzeige

Weitere Verwandte Inhalte

Ähnlich wie Implementing Resilience with Micronaut (20)

Weitere von Naresha K (20)

Anzeige

Aktuellste (20)

Implementing Resilience with Micronaut

  1. 1. Implementing Resilience with Micronaut Naresha K @naresha_k https://blog.nareshak.com/
  2. 2. About me Developer, Architect & Tech Excellence Coach Founder & Organiser Bangalore Groovy User Group
  3. 3. • The Network is Reliable • Latency is Zero • Bandwidth is Infinite • The Network is Secure • Topology Doesn’t Change • There is One Administrator • Transport Cost is Zero • The Network is Homogeneous https://web.archive.org/web/20171107014323/http://blog.fogcreek.com/eight-fallacies-of-distributed-computing-tech-talk/ Fallacies of distributed computing
  4. 4. Timeout
  5. 5. package com.nareshak.demo import io.micronaut.http.annotation.Get import io.micronaut.http.client.annotation.Client @Client(value = "http://localhost:8081/") interface PresentationClient { @Get("/{presentationId}") PresentationInfo getPresentationInfo(Long presentationId) }
  6. 6. micronaut: http: client: read-timeout: 5s application.yml
  7. 7. Retry
  8. 8. @Retryable(attempts = "5", delay = "2s", multiplier = "2.0") PresentationInfo getPresentation() { }
  9. 9. package com.nareshak.demo import io.micronaut.http.annotation.Get import io.micronaut.http.client.annotation.Client import io.micronaut.retry.annotation.Retryable @Client(value = "http://localhost:8081/") @Retryable(attempts = "5", delay = "2s", multiplier = "2.01") interface PresentationClient { @Get("/{presentationId}") PresentationInfo getPresentationInfo(Long presentationId) }
  10. 10. Circuit Braker
  11. 11. package com.nareshak.demo import io.micronaut.http.client.annotation.Client import io.micronaut.retry.annotation.CircuitBreaker @Client(value = "http://localhost:8081/") @CircuitBreaker(reset = "60s", attempts = "1") interface PresentationClient extends PresentationOps { }
  12. 12. Fallback
  13. 13. package com.nareshak.demo import io.micronaut.retry.annotation.Fallback @Fallback class PresentationClientFallback implements PresentationOps { @Override PresentationInfo getPresentationInfo(Long presentationId) { new PresentationInfo(title: “TBD") } }
  14. 14. References • https://github.com/naresha/agileindia2020resiliencemincronaut • https://micronaut.io/
  15. 15. Thank You

×