Retry web service operations with RequestHandlerRetryAdvice

1 Introduction Sometimes when invoking a web service, we may be interested in retrying the operation in case an error occurs. When using Spring Integration, we can achieve this functionality with RequestHandlerRetryAdvice class. This class will allow us to retry the operation for a specified…

How error handling works in Spring Integration

1 Introduction The target of this post is to show you how error handling works in Spring Integration, using the messaging system. You will see that error handling is different between synchronous and asynchronous messaging. As usual, I’ll skip the chat and proceed with some…

Spring Integration – Using RMI Channel Adapters

1 Introduction This article explains how to send and receive messages over RMI using Spring Integration RMI channel adapters. It is composed of the following sections: Implement the service: The first section focuses on creating and exposing a service. Implement the client: Shows how to…

Creating contract-first web services with Spring WS

1 Introduction This article explains how to implement and test SOAP web services with Spring WS project. This example uses JAXB2 for (un)marshalling. To develop the service, I’ll use the contract-first approach, which consists in defining the service contract first, and based on this contract implement…

Processing messages in transactions with Spring JMS

1 Introduction This post shows how to process messages in transactions with Spring JMS. We will see how an error in the execution of the consumer during the asynchronous reception of messages with JMS, can lead to the loss of messages. I then will explain…

Introduction to messaging with Spring JMS

1 Introduction to Spring JMS In this post I will show you how to configure a standalone application in order to see different ways of sending and receiving messages using Spring JMS. Basically, I will divide the examples into the following sections: Point-to-point messaging (queue)…

Applying aspect oriented programming

1 Introduction This article explains how to apply aspect oriented programming with Spring AOP. The main target of the aspect oriented programming is the separation of cross-cutting concerns. When we talk about cross-cutting concerns we are referring to generic functionality that is used in several…

Retrieving method annotations with Spring AnnotationUtils

1 Introduction to Spring AnnotationUtils The JDK provides us with several lookup methods that allow us to retrieve annotations from a class, method, field or added to method parameters. The Spring AnnotationUtils is a general utility class for annotations which extends the basic functionalities. In…

Unit testing with PowerMock

In this article I will implement unit testing with PowerMock library. This framework is more powerful than other libraries and allows you to mock static methods, private methods and change field properties among other things. I will use the Mockito extension but it also supports…