Posts

Showing posts from July, 2019

Spring Boot / Swagger / Prometheus / Grafana

Simple (H2) CRUD application demonstrating Spring Boot  Swagger Prometheus Grafana https://dzone.com/articles/monitoring-using-spring-boot-2-prometheus-amp-graf List of Spring Metrics: https://docs.spring.io/spring-metrics/docs/current/public/prometheus

Javax Websocket, WebSocket protocol, ws://*** and wss://***

Javax Websocket provided within javax.websocket package, including: "@ServerEndpoint: If decorated with @ServerEndpoint, the container ensures availability of the class as a WebSocket server listening to a specific URI space @ClientEndpoint: A class decorated with this annotation is treated as a WebSocket client @OnOpen: A Java method with @OnOpen is invoked by the container when a new WebSocket connection is initiated @OnMessage: A Java method, annotated with @OnMessage, receives the information from the WebSocket container when a message is sent to the endpoint @OnError: A method with @OnError is invoked when there is a problem with the communication @OnClose: Used to decorate a Java method that is called by the container when the WebSocket connection closes ..." See more at https://www.baeldung.com/java-websockets Websocket Protocol WebSocket is distinct from HTTP. Both protocols are located at layer 7 in the OSI model and depend on TCP at layer 4. RFC 6455 s

Reactive Spring

More info:  https://stackify.com/reactive-spring-5/ As of spring 5, spring WebFlux project offers an implementation of reactor project . WebFlux can be used in spring boot applications via: <artifactId> spring-boot-starter-webflux </artifactId> instead of spring boot starter web, and uses Netty as non-blocking webserver. "Writing a non-blocking, reactive HTTP Client with Spring WebFlux is a case of using the new WebClient class instead of the RestTemplate class. This class allows us to make a request to the server, and apply transformations and actions to the response when it eventually comes back, all without blocking any other operations in our code.... Conversely, we can write reactive controllers that will read data from the client and process it as it comes in... In a traditional server, the data would be loaded entirely from the database to the server before any of it was sent back from the server to the client... In a reactive server, the data will