Reputation: 2827
I'm trying to study how Spring Integration works (with extramly difficult, on the net there are a tons of source code but without some real step-by-step tutorial) and i would like to use it in my own application.
I will have to write a client/server application where the server endpoint is a Webservice and the client will be a Standalone app.
The standalone app will collect some data (creating different POJO, because each kind of that have different members) and next will invoke a WebService that store it in database.
The idea is to have a single REST Endpoint on WebService, in this way i dont have to create different one if i will have to expand my Standalone app.
My problem is: because the Endpoint will be only one, there is a way to apply some "transformation" when the webservice is invoked so i can manage different data?
For example:
Standalone app collect data (class1) -> Invoke webservice -> Webservice apply some transormation regardless Class1 type -> Save the data
Standalone app collect data (class2) -> Invoke webservice -> Webservice apply some transormation regardless Class2 type -> Save the data
So, each class have its own "transformation" that know what to do with this data.
A better real example could be this:
Class1 - Is a class with a single member (a String)
Class2 - Is a class with two member (a String and a Integer)
The Standalone App invoke wbs passing it Class1, the wbs with (transformation?) manage Class1 and store the data
The same process will be replaced to Class2
Doing this flow, when later i will have to expand this applications, i will have to write only the transformation (on wbs side) and how the data have to be collected (on Client side).
Someone could show me some starting point (tutorial, examples ecc) on this kind of argument ?
Unfortunally, with my low experience with SI i really dont know where to start with this argument. I just have seen that this framework have a lot of functionality and maybe exists something that handle this.... but i dont know how to find :(
Upvotes: 1
Views: 82
Reputation: 174554
I suggest you familiarize yourself with the Enterprise Integration Patterns and read the Spring Integration Reference and look at the samples.
In your case, you could use a Payload Type Router to route the messages to different flows based on the inbound payload type.
Creating a step-by-step tutorial for every use case would be an enormous task.
We're happy to help further if/when you have specific questions; consider contributing a sample when you get it working.
Upvotes: 1