WebFlux contains support for reactive HTTP and WebSocket clients. WebSockets allows communication in both directions and this could happen simultaneusly, therefore WebSockets are the best way to deliver real time data bi-direactional using both text or binary content. This time we will review how to build a WebFlux application using WebSockets from both client and server. If you want to know more about how to create Spring Webflux please go to my previous post getting started with Spring Webflux here.
[Read More]
Spring Webflux Constructor Injection
Lombok is a great tool to avoid boilerplate code, this time we will show you how to do constructor injection using Lombok in a Spring Webflux application. If you want to know more about how to create Spring Webflux please go to my previous post getting started with Spring Webflux here. Then, let’s create a new Spring Boot project with Webflux as dependencies:
spring init --dependencies=webflux,lombok --build=gradle --language=java spring-webflux-required-args-constructor Here is the complete build.
[Read More]
Spring Webflux JAXB
In this technical post we will take a look at how to produce XML using JAXB Jakarta EE implementation. Java Architecture for XML Binding (JAXB) provides an API and tools that automate the mapping between XML documents and Java objects. NOTE: If you need to know what tools you need to have installed in your computer in order to create a Spring Boot basic project, please refer my previous post: Spring Boot.
[Read More]
Spring Boot XML Schema
XML is still the most sophisticated format for distributed data, when you have complete control between your clients and services JSON is the king, but if not, you probably will need to deal with XML, and there is for good reasons:
XML is a W3C standard XML can be validated using Schemas XML embraces extensibility Supports multilingual documents Can embed multiple data types All those reasons are important, but most important is that we can validate any XML using XSD Schemas, in this technical post we will see how to generate Java classes using XSD eschemas with JAXB2 and Spring Boot.
[Read More]
Spring Webflux Webclient Headers
HTTP headers allow the client and the server to pass additional information with the request or the response, if you want to know more about the list we can use as Http headers, please go here. In this technical post we will see how to validate a server response including their headers using WebTestClient. If you want to know more about how to create Spring Webflux please go to my previous post getting started with Spring Webflux here.
[Read More]
Spring Webflux URI Validator
Spring Framework Validated Is designed for convenient use with Spring’s JSR-303 and allows to express and validate application constraints, in this technical post we will see how to validate a path variable using Spring Validated annotation in a Spring Webflux application, if you want to know more about how to create Spring Webflux please go to my previous post getting started with Spring Webflux here. Then, let’s create a new Spring Boot project with Webflux and Lombok as dependencies:
[Read More]
Spring Boot H2
In this technical post we will review how to integrate an H2 in memory database in a Spring Webflux application. Please read this previous Spring Webflux Basics before conitnue with this information. Then, let’s create a new Spring Boot project with Webflux, Lombok, JPA and H2 as dependencies:
spring init --dependencies=webflux,lombok,jpa,h2 --language=java --build=gradle spring-boot-h2 Here is the complete build.gradle file generated:
plugins { id 'org.springframework.boot' version '2.1.4.RELEASE' id 'java' } apply plugin: 'io.
[Read More]
Spring Boot Server-sent Events Client
In this technical post we will see how to consume events using Sever-sent events in a Spring Webflux application. Please read this previous Spring Boot Server-sent Events before conitnue with this information. Then, let’s create a new Spring Boot project with Webflux and Lombok as dependencies:
spring init --dependencies=webflux,lombok --language=java --build=gradle spring-boot-sse-client Here is the complete build.gradle file generated:
plugins { id 'org.springframework.boot' version '2.3.4.RELEASE' id 'io.spring.dependency-management' version '1.0.10.RELEASE' id 'java' } group = 'com.
[Read More]
Spring Boot Server-sent Events
In this technical post we will see how to integrate Sever-sent events in a Spring Webflux application. Please read this previous Spring Webflux Basics before conitnue with this information. Then, let’s create a new Spring Boot project with Webflux and Lombok as dependencies:
spring init --dependencies=webflux,lombok --language=java --build=gradle spring-boot-sse Here is the complete build.gradle file generated:
plugins { id 'org.springframework.boot' version '2.3.4.RELEASE' id 'io.spring.dependency-management' version '1.0.10.RELEASE' id 'java' } group = 'com.
[Read More]
Spring Boot JsonNode
In computer science, marshalling is the process of transforming the representation of an object to a data format suitable for storage or transmission. In this technical post we will describe how we can marshall and unmarshall using Jackson, JsonNode and Spring Boot. If you want to know more about how to create Spring Webflux please go to my previous post getting started with Spring Webflux here. First let’s create a new Spring Boot Webflux project:
[Read More]