My goal is to use Spring Integration to control the flow between multiple systems and add some logging and monitoring.
One of the systems is a RESTful MVC service. I read the Spring Integration document here: http://static.springsource.org/spring-integration/reference/htmlsingle/#http-inbound. There is a line here that I don’t understand:
If you are running within a Spring MVC application, then the aforementioned explicit servlet definition is not necessary. In that case, the bean name for your gateway can be matched against the URL path just like a Spring MVC Controller bean.
Can someone provide an example of integrating a Spring MVC restful endpoint with Spring Integration? Ideally it would be nice to reuse the mapping definitions in my Controller that I’ve already defined, but perhaps that isn’t the intended use case?
The discussion there is to route HTTP requests to an http inbound gateway.
If you already have a Controller, simply inject a MessagingGateway to invoke your Spring Integration flow…
http://static.springsource.org/spring-integration/reference/html/messaging-endpoints-chapter.html#gateway