Testing Spring Webflux router functions

Router functions play a similar role in Spring Webflux as controllers in Spring MVC. Both are responsible for handling HTTP requests/responses. However, compare to controllers, new approach is not represented by a single component, but consists of two parts: a router function and a handler, which serves as glue between service (business logic) and HTTP […]

Read More

Validation for Spring Webflux APIs with Yavi

In Spring MVC a server-side validation was implemented using annotations. We could just put @Valid before the body payload in the controller method and Spring did all dirty work for us. On the other side, Spring Webflux implements a functional-style web layer, which is based on router functions and handlers. This is non-blocking API and […]

Read More

How to use iterators in Java

The iterator pattern is one of approaches to access elements of a collection, alongside with streams. From a technical point of view, the iterator traverses elements in a sequential and predictable order. In Java the behavior of iterators is defined in java.util.Iterator contract, which is a member of Java Collections Framework. Iterators are similar to […]

Read More

Some thoughts on server side validation with Vertx and a bit of Vavr

Eclipse Vertx is a robust technology to build reactive microservices or serverless functions. When you develop such applications, the role of server side validation rises. In traditional web applications we combine both client-side and server-side validation techniques. However, in API world we can be in situations without clients (when you have a public API). We […]

Read More

How to check if a list contains a value in Clojure

Recently I started to learn Clojure, and usually, my first phase is to complete small programming exercises. To practice Clojure I decided to solve some CodingBat problems. A common task here is to check, if an array does contain some value. The expected result should be a boolean value. When I moved to practical implementations, […]

Read More

Home made JWT authentication for Javalin

An authentication with tokens became a must-have feature for modern web apps. It suits natively to single page applications and mobile applications. While Spring is de facto standard in Java ecosystem, there are developers, who prefer to use alternative solutions. This is true, because Spring is quite heavy platform and there is a number of […]

Read More

Understand Java Collections

When we talk about Java collections, we consider two things. First, more wide concept, means implementations of common data structures. An another, narrow understanding, corresponds to concrete interfaces and their implementations, that are contained in Java Collections Framework, supplied out-of-the box. In that sense, we need to remember that such collections inherit to the root […]

Read More

Secure Webflux API endpoints with HandlerFilterFunction

In the previous post we have already talked about authentication in Spring Webflux. We implemented a component, that contains a required business logic to process login and signup, and to issue JWT. However, to fullfil this security flow, we also need a component, that we assert a token: extract Authorization header from HTTP request and […]

Read More