-
Grouping, transforming and reduction with Java 8
Java, Java8 ·In this previous post, I wrote about how we can group collections of objects with streams and grouping. This is useful but does not cover specific use cases. For example, sometimes we do not only need to group things but also transform the result into a more appropriate object.
In this post, we will learn how to...
-
Multi level grouping with streams
Java, Java8 ·With Java 8 streams it is pretty easy to group collections of objects based on different criteria. In this post, we will see how we can make stream grouping, from simple single level groupings to more complex, involving several levels of groupings.
We will use two classes to represent the objects we want to group by: person and pet.
Person.class
... -
Understanding Callable and Spring DeferredResult
Spring, Spring MVC, Spring-Boot ·Asynchronous support introduced in Servlet 3.0 offers the possibility to process an HTTP request in another thread. This is specially interesting when you have a long running task, since while another thread processes this request, the container thread is freed and can continue serving other requests.
This topic has been explained many times, but there seems to be a little...
-
Configure a Spring JMS application with Spring Boot and annotation support
Spring, Spring JMS, Spring-Boot ·In previous posts we learned how to configure a project using Spring JMS. If you check the article introduction to messaging with Spring JMS, you will notice that it is configured using XML. This article will take advantage of the improvements introduced in Spring 4.1 version, and configure a Spring JMS application with Spring...
-
Improving performance: non-blocking processing of streams
Concurrency, Java, Java8 ·Imagine we have an application that needs to access an external web service in order to gather information about clients and then process it. More specifically, we can’t get all this information in a single invocation. If we want to look up different clients, we will need several invocations.
As shown in the graphic below, the example application will retrieve...