Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it worth to use Spring Integration instead of Spring MVC for web-based or mobile based application?

I am developing web application, also in my product we are also providing financial-non financial mobile services.

Going in details.

In my web application, there is nothing like maintaining flows step by step , simple all CRUD operations and currently we are using Spring MVC which fits to our requirement but for mobile based services, we are providing like message bus support to exchange piggy back information between client and server and we have custom code to implement the solution.

Also our mobile based services need to be exposed over different protocols like SOAP,REST along with need of decoupling of communication packets from services.

All above problems we solved using SPRING MVC only.

My Question is

  1. Is it worth to use Spring Integration framework to replace custom code solution to implement message bus with Spring Integration and if so, what will be the flow for my web application?
  2. If I am using Spring Integration for my web application, how it will render HTTP request to SI?
  3. Is Spring Integration is right choice for any standalone web based application?
like image 877
Ketan Avatar asked Apr 15 '13 13:04

Ketan


People also ask

Can spring be integrated with other MVC frameworks?

Spring Web Flow (SWF) aims to be the best solution for the management of web application page flow. SWF integrates with existing frameworks like Spring MVC, Struts, and JSF, in both servlet and portlet environments.

Is spring MVC still relevant?

Spring MVC Benefits Spring MVC shines when it comes to: Promoting separation of concerns - it's great way to develop modular web applications. Abstracts away the tedious and boilerplate tasks of handling HTTP requests. Excellent support for developing RESTful web services.

Why do we need spring integration?

Spring Integration provides a lot of powerful components that can greatly enhance the interconnectivity of systems and processes within an enterprise architecture. It embodies the some of the finest and most popular design patterns, helping developers avoid rolling their own.


1 Answers

Spring Integration is modeled on the Enterprise Integration Patterns and can be best thought of as support Message Driven Architecture. Spring MVC's history and origins is in providing a solution for the MVC pattern akin to Struts, exposing Models and Controlling Views, supported by Services, primarily in a linear fashion. One of the cores of Spring MVC was allowing the dynamic population of a Model that would be accessed by a JSP page (View). All of these things being Web App orientated and ending their.

With the evolution of services (Web, RESTful), Spring MVC has filled a gap and continually expanded to support HTTP access to services, though this is an expansion of its duties, rather than first origins. Meanwhile, Spring Integration was designed with the view of handling Messages and a messages interaction with services, independent of the protocol that it was accessed on. To enable different protocols, different endpoints are available to expose the same service. For example, I can have my crud services built in a POJO, exposed through a Service Activator, and now available to a number of different protocols including REST via HTTP, WebServices, Twitter, XMPP chat services, RMI, TCP, etc. etc.

in short, Spring MVC == HTTP access, Spring Integration == Message access (from HTTP, File, DB, etc.)

to expose a service via HTTP in Spring Integration, use the HTTP endpoints. Typically in a Request/Response (say a Read from a database) you'll want to use the <int-http:inbound-gateway/> and it would look something like this;

<int-http:inbound-gateway request-channel="request.channel" reply-channel="reply.channel"
   path="/myService" supported-methods="GET"/>
<int:channel id="request.channel"/>
<int:service-activator input-channel="request.channel" ref="myService"/>
<int:channel id="output.channel"/>

(a key point to remember to is the following...

<bean class="org.springframework.integration.http.inbound.UriPathHandlerMapping"/>

this helps map the path attribute of the inbound-gateway to the servletdispatcher)

like image 166
incomplete-co.de Avatar answered Sep 23 '22 15:09

incomplete-co.de