Articles

In this example, I am going to show you how to post data to a RESTful web service in Java using Spring, Spring Java Configuration and more.

Web Service Code

Let’s take a quick look at the Spring MVC Web Service code on the server:

Source de l’article sur DZONE

I’m not going to explain what reactive programming is or why you should use it. I hope you’ve already read about it somewhere, and if not, you can Google it. In this post, I’m going to tell you how to use reactive programming specifically with Spring Boot and RxJava. Let’s get started.

Prerequisites

Before you continue reading, I expect you understand how to create simple REST API using Spring Boot and RxJava. If you haven’t, you can learn more about Spring Boot on Baeldung and you can learn more about RxJava on AndroidHive. They explain those two materials really well.

Source de l’article sur DZONE

See how Spring Boot Batch Application saves an XML to the database and moves error/success files to error/success folder and archives error/success files.

This example covers multiple Spring Batch concepts that we need in most of our daily routine batch job implementations.

Source de l’article sur DZONE

Config servers are widely used in microservices architectures as placeholders for configurations. They also provide a centralized repository for users to manage configs for multiple applications.

Today, we are going to look at an example of how to use Nacos as a config server with Spring Cloud for Alibaba. The example is a Spring Boot application, running a Nacos server locally.

Source de l’article sur DZONE

If you are developing an event-based application that handles many requests from different users, you most likely want to count distinct user action within a sliding window or a specified time range.

One of the quickest ways to count distinct user is to prepare an SQL like SELECT count(distinct user) from ACTION_TABLE. But, this might be expensive if there are millions of records produced in real time.

Source de l’article sur DZONE

In this article, I will explain how to return custom HTTP errors in Spring Boot. When we make an HTTP request to a resource, it is common that the request has to consider the option of returning an error.

It is the typical case that we made a RESTful request to query for a record, but it does not exist. In this case, you will usually return an HTTP code 404 (Not Found), and with this code, you also return a JSON object that with a a format defined for Spring Boot, like this:

Source de l’article sur DZONE

In this article, we will be talking about Server Push Technology that is actually part of the HTTP/2 spec.

The most important feature of Servlet 4.0, due to HTTP/2, is the implementation of the server push capability. The concept behind this technique is that if the client/browser requests a certain resource, the server assumes, in advance, that some other related resources may also be requested soon. Because of this assumption, it pushes them into the cache (called ‘cache push’) before they are actually needed. For example, it is very much likely that when a webpage is loaded, it may eventually request a CSS file or another image. The server proactively starts pushing the bytes of these assets simultaneously, without the need for the client to make an explicit request.

Source de l’article sur DZONE

I have been using the Trello board over the last few months for project management. During this period, I needed to generate reports via Word or DOCX, and among the constraints, I found that there are cards written in different languages.

In this article, I will provide a detailed Java program that can generate a DOCX report of a Trello board and translate content into a single output language, basing it on Google Translation and Cloud API Translation.

Source de l’article sur DZONE