Articles

Use the Spring Cloud Load Balancer!

You may also like: Service Discovery and Client-Side Load Balancing With Eureka and Ribbon

Almost a year ago Spring Cloud has announced that most of Spring Cloud Netflix OSS projects will be moved to the maintenance mode starting from Spring Cloud Greenwich Release Train. The maintenance mode only does not include Eureka, which still will be supported. I referred to that information in one of my previous articles The Future of Spring Cloud Microservices After Netflix Era.

Source de l’article sur DZONE

Spring Batch

In this post, we will show you how to use Spring Batch to read an XML file with your ItemReader using StaxEventItemReader and write its data to Oracle Database using Custom ItemWriter. We will also learn how to use ItemProcessor to process input data before writing to the database.

Custom ItemReader or ItemWriter is a class where we write our own way of reading or writing data. In Custom Reader we are required to handle the chunking logic as well. This comes in handy if our reading logic is complex and cannot be handled using Default ItemReader provided by spring.

Source de l’article sur DZONE

Through Spring Aware interfaces, you can access Spring bean lifecycle events.

Spring Aware interfaces allow you to look into the inner workings of the Spring Framework. Through Spring Aware interfaces, you can access the Spring context, or Spring bean lifecycle events.

Your Spring beans might require access to framework objects, such as ApplicationContext, BeanFactory, and ResourceLoader. To gain access, a bean can implement one of the many Aware interfaces of the Spring Framework.

Source de l’article sur DZONE

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

In this article, I am going to talk about how to best implement filters over HTTP requests in Spring. That is, assuming we have a program listening in a URI, we can specify that we want to execute something before the requests are processed by the controller.

This is very useful if we want all the requests to meet a requirement, for example, that they must include a specific header.

Source de l’article sur DZONE

In the video below, we take a closer look at how to send or receive product objects to or from a queue using Spring, JMS, and RabbitMQ with annotations. So, let’s get started!

Check out the links below to download the code and PPT:

Source de l’article sur DZONE

Thinking of upgrading your Spring Boot application? In this post, I’d like to walk you through the process of upgrading a Spring Boot 1.x app to Spring Boot 2.

Dependencies

Java

Spring Boot 2.x will no longer support Java 7 and below, with Java 8 as the minimum requirement.

Source de l’article sur DZONE

Hi, Spring fans! Happy New Year to you! Here’s hoping that your new year is healthier and happier than the last. 

Also, this is the eighth anniversary of This Week in Spring, I started this series in the first week of January 2011. We’ve come a long way since then! This is as good a time as any to remind you that I love this community and I love reading what you’re up to. It’s a pleasure to learn right along with you. As always, I’m grateful for any contributions in this humble roundup; just hit me up on Twitter. My Direct Messages are wide-open. Thank you for everything you’ve done to drive this and for everything I know you will do, dear reader.

Source de l’article sur DZONE


Hi, Spring fans, and welcome to another installment of This Week in Spring! This week, I’ve been in Seattle, WA, and now, I’m off to Toronto, Canada, for the epic SpringOne Tour Toronto edition, the last SpringOne Tour for the year, too! (Can you believe we’re now less than 22 days from 2019? Time sure flies when you’re having fun!)

Source de l’article sur DZONE