Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Programación Reactiva con Spring WebFlux

Programación Reactiva con Spring WebFlux

Una de las características más llamativas de Spring 5 es Spring WebFlux, un framework de programación funcional aplicando patrones reactivos. En esta charla haremos uso de los conceptos reactivos y programación para conectarnos a una base de datos usando Spring Data y Spring WebFlux. Configuraremos Spring Data a nivel Reactivo. Aprovechar las ventajas de Spring Framework 5, WebFlux, Project Reactor.

Link: https://www.youtube.com/watch?v=1nOW7cm8DB8

Geovanny Mendoza Gonzalez

September 26, 2020
Tweet

More Decks by Geovanny Mendoza Gonzalez

Other Decks in Technology

Transcript

  1. 2 2 Agenda • Introducción • Reactive Streams • Project

    Reactor • Spring WebFlux • Demo • Endpoints Funcional • Server Side Events • Conclusiones
  2. Acerca de mí 3 Certificado en Vaadin 14 Professional &

    Developer 3 Jug Leander 12+ de experiencia Ing. Sistemas Especialista en Ing. Software Desarrollador Full Stack en Sophos Solutions Blog: http://geovanny0401.blogspot.com/
  3. 9

  4. • Programación Reactiva - Conceptos Reactive Streams • https://projectreactor.io/ 12

    • Observables. • Emiten el flujo de datos. • Observers. • Se les notifican los cambios en el flujo de datos. • Se crean del lado ‘Publisher’. • Se comparte con el ‘Subscriber’. • Puedes ser utilizado entre el ‘Publisher’ y el ‘Subscriber’. Publisher Subscriber Subscription Processor
  5. 37 37 Server Side Events • Server Sent Events(SSE) es

    una tecnología que permite a un navegador recibir actualizaciones automáticas de un servidor a través de una conexión HTTP. • ¿Diferencia con los webSocket? Los webSockets son un sistema de comunicación basado en TCP que permite comunicación bi-direccional entre cliente y servidor
  6. 39 39 Rendimiento Spring MVC Spring WebFlux • Spring MVC:

    1.5.10.RELEASE • Spring WebFlux: 2.0.0.RELEASE • 2500 Usuarios (4 Solicitudes/Usuarios) Fuente: https://medium.com/@the.raj.saxena/springboot-2-performance-servlet-stack-vs-webflux-reactive-stack-528ad5e9dadc
  7. 40 40 Rendimiento Spring MVC Spring WebFlux • Spring MVC:

    1.5.10.RELEASE • Spring WebFlux: 2.0.0.RELEASE • 5000 Usuarios (4 Solicitudes/Usuarios) Fuente: https://medium.com/@the.raj.saxena/springboot-2-performance-servlet-stack-vs-webflux-reactive-stack-528ad5e9dadc
  8. 41 41 Rendimiento Spring MVC Spring WebFlux • Spring MVC:

    1.5.10.RELEASE • Spring WebFlux: 2.0.0.RELEASE • 10000 Usuarios (4 Solicitudes/Usuarios) Fuente: https://medium.com/@the.raj.saxena/springboot-2-performance-servlet-stack-vs-webflux-reactive-stack-528ad5e9dadc
  9. 42 42 Rendimiento • Spring Boot: 2.1.2 • Java: 11

    OpenJDK 2.0.0 • Node: t2.micro (Amazon Linux) Fuente: https://medium.com/@filia.aleks/microservice-performance-battle-spring-mvc-vs-webflux-80d39fd81bf0
  10. 43 43 Rendimiento • Spring Boot: 2.1.2.RELEASE • Java: 11

    OpenJDK 2.0.0 • Node: t2.micro (Amazon Linux) Fuente: https://medium.com/@filia.aleks/microservice-performance-battle-spring-mvc-vs-webflux-80d39fd81bf0
  11. 44 44 Referencias • https://projectreactor.io/ • https://www.devglan.com/spring-boot/spring-webflux-reactive-rest-api • https://www.slideshare.net/paradigmatecnologico/programacin-reactiva-con-spring-webflux •

    https://docs.spring.io/spring-framework/docs/5.0.0.M1/spring-framework-reference/html/web-reactive.html • https://www.codesolt.com/eventos/charlas/jvm-mx-spring-webflux/ • https://www.arquitecturajava.com/que-es-spring-webflux/ • http://maddy4java.blogspot.com/2019/11/spring-boot-spring-webflux-vs-spring-mvc.html • https://blog.nebrass.fr/playing-with-reactive-spring-boot/ • https://www.youtube.com/channel/UCEOmqvughG1gbKfv5J1U1Dw Canal de Joedayz • https://www.youtube.com/channel/UC9fAeSPVw7mAAbexCS7gPqw Canal de MitoCode • https://github.com/Geovanny0401/spring-webflux-jugnicaragua • https://github.com/Geovanny0401/spring-webflux-endpoint-funcional Repositorio