Mistre83
Mistre83

Reputation: 2827

Spring Integration Webservice vs. RestTemplate

I'm trying to learn SI (Spring Integration) but i'm a bit confused on the real usage of this.

As first example i would like to interact with a WebService but i dont understand what could be the difference from

So, what is the benefit of using SI (in Webservice context, or in other context)?

Looking the web, i havent find an article that explain:

To be more explicit on what i have to realize, this is an example:

1) I have to write an application (Standalone application) that have to collect some data in the system periodically and then invoke a Web Service that will store it.

2) The Web Service receive the call from the "clients" and store in the database.

My webservice will use REST.

The reason because i've think to use SI is that the Standalone Application should interact with different system

Upvotes: 3

Views: 2277

Answers (1)

Marged
Marged

Reputation: 10953

If you only need to pull some data in a simple way and push it onwards to a REST service this does not "justify" the use of Spring Integration. A simple Spring (Boot) application combined with a scheduler will be sufficient.

But if you want to use a more complex data source for which an endpoint is available, you need transformations, complex and flexible routing is a high priority or even Enterprise Integration Patterns (EIP) then Spring Integration is for you. Have a look at the Overview and decide if it mentions something you consider as valuable to you. Perhaps you will create additional value by mixing in Spring Batch if you need to process a lot of data.

But as I understand your current demand starting with just a RESTTemplate should do for the moment. Starting small will not prevent you from switching to Spring Integration later on. Have a look at the various tutorials and guides provided by the Spring Boot project. There is even an example for Spring Integration.

Upvotes: 2

Related Questions