Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

INT-2312: HTTP RequestMapping support #723

Closed
wants to merge 14 commits into from

4 participants

@artembilan
Collaborator

The general idea to use Spring-MVC as much as possible.

  • introduce RequestMapping, IntegrationRequestMappingHandlerMapping
  • introduce XSD nested element <request-mapping> for HTTP Inbound Endpoints
  • introduce inboundCommonAttributes XSD attributeGroup for HTTP Inbound Endpoints
  • introduce IntegrationNamespaceUtils#createExpressionDefIfAttributeDefined & IntegrationNamespaceUtils#createDirectChannel
  • remove deprecated name attribute
  • remove UriPathHandlerMapping as superseded by IntegrationRequestMappingHandlerMapping

JIRA: https://jira.springsource.org/browse/INT-2312, https://jira.springsource.org/browse/INT-2619

@artembilan
Collaborator

Pushed commit which is addressed: https://jira.springsource.org/browse/INT-2528.
There is no need a lot of changes.

@garyrussell garyrussell commented on the diff
...integration/config/xml/IntegrationNamespaceUtils.java
@@ -55,11 +61,11 @@
*/
public abstract class IntegrationNamespaceUtils {
- static final String BASE_PACKAGE = "org.springframework.integration";
- static final String REF_ATTRIBUTE = "ref";
- static final String METHOD_ATTRIBUTE = "method";
- static final String ORDER = "order";
- static final String EXPRESSION_ATTRIBUTE = "expression";
+ public static final String BASE_PACKAGE = "org.springframework.integration";
@garyrussell Owner

Why is this now public? We are phasing it out (at least when generating class names in parsers).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
...integration/config/xml/IntegrationNamespaceUtils.java
@@ -298,7 +304,8 @@ public static BeanComponentDefinition parseInnerHandlerDefinition(Element elemen
/**
* Utility method to configure HeaderMapper for Inbound and Outbound channel adapters/gateway
*/
- public static void configureHeaderMapper(Element element, BeanDefinitionBuilder rootBuilder, ParserContext parserContext, Class<?> headerMapperClass, String replyHeaderValue){
+ public static void configureHeaderMapper(Element element, BeanDefinitionBuilder rootBuilder,
+ ParserContext parserContext, Class<?> headerMapperClass, String replyHeaderValue){
@garyrussell Owner

missing space before {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
...integration/config/xml/IntegrationNamespaceUtils.java
((15 lines not shown))
}
return expressionDef;
}
+
+ public static BeanDefinition createExpressionDefIfAttributeDefined(String expressionElementName, Element element) {
+
+ Assert.hasText(expressionElementName, "'expressionElementName' must no be empty");
@garyrussell Owner

s/no be/not be/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
...ntegration/http/config/HttpInboundEndpointParser.java
((79 lines not shown))
}
private String getInputChannelAttributeName() {
return this.expectReply ? "request-channel" : "channel";
}
- private String createDirectChannel(Element element, ParserContext parserContext) {
- String channelId = element.getAttribute("id");
- if (!StringUtils.hasText(channelId)) {
- parserContext.getReaderContext().error("The channel-adapter's 'id' attribute is required when no 'channel' "
- + "reference has been provided, because that 'id' would be used for the created channel.", element);
+ private BeanDefinition createRequestMapping(Element element) {
+ BeanDefinitionBuilder requestMappingDefBuilder =
+ BeanDefinitionBuilder.genericBeanDefinition(IntegrationNamespaceUtils.BASE_PACKAGE + ".http.inbound.RequestMapping");
@garyrussell Owner

use RequestMapping.class.getName()

@artembilan Collaborator

No, RequestMapping is package protected. And that's why I make IntegrationNamespaceUtils#BASE_PACKAGE public.
However agree: I can revert the public modificator and use full string of class name, as it is done in many other non-core modules.

@garyrussell Owner

Ah... ok... I have no problem with making the constant public if this is the reason - I just wanted to be sure we weren't using the String instead of the (preferred) class to get its name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
.../http/inbound/HttpRequestHandlingEndpointSupport.java
((6 lines not shown))
private static boolean romePresent = ClassUtils.isPresent("com.sun.syndication.feed.WireFeed",
HttpRequestHandlingEndpointSupport.class.getClassLoader());
- private volatile List<HttpMethod> supportedMethods = Arrays.asList(HttpMethod.GET, HttpMethod.POST);
+ private static final List<HttpMethod> nonReadableBodyHttpMethods =
@garyrussell Owner

I am not keen on this variable name. How about httpMethodsWithNoBody ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
src/reference/docbook/http.xml
((8 lines not shown))
<ulink url="http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/web/servlet/HandlerMapping.html"
><interfacename>HandlerMapping</interfacename></ulink> matches against
the value of the <emphasis>path</emphasis> attribute.
</para>
- <programlisting language="xml"><![CDATA[<bean class="org.springframework.integration.http.inbound.UriPathHandlerMapping"/>]]></programlisting>
+ <programlisting language="xml"><![CDATA[<bean class="org.springframework.integration.http.inbound.IntegrationRequestMappingHandlerMapping"/>]]></programlisting>
<para>
For more information regarding <emphasis>Handler Mappings</emphasis>, please
see:
@garyrussell Owner

We need some documentation for the <request-mapping/> element.

Also, I only see 'headers' in the test cases, what about 'produces', 'consumes', 'params' attributes?

@artembilan Collaborator

I was going to modify documentation in the separate JIRA: it's still difficult to me to express my thoughts in english.
So I have needed the approvement of the solution for a start.
Should I do it here, or separate JIRA is OK? Of couse it will be in 3.0.M2 already...
About tests. Np, will be pushed soon, although they will look as double check how Spring MVC works, because as I said this solution fully based on Spring MVC abilities.
Other comments will be addressed too.

@garyrussell Owner

We've deferred documentation in the past, but we really want to try to get docs aligned with the Milestone - particularly later milesones, when we want people to try out the new features. I am ok with deferring the docs to another JIRA, if we can at least put a note in the migration guide (even if we eventually remove it from there).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
...ramework/integration/http/inbound/RequestMapping.java
((4 lines not shown))
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springframework.integration.http.inbound;
+
+import java.util.ArrayList;
+import java.util.List;
@garyrussell Owner

Unused imports - you can configure STS to organize imports on save.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@artembilan
Collaborator

Pushed commit regarding documentation for <request-mapping> and additional tests for it.
Other comments are addressed too.
If it will be OK and necessary, I'll add a note to the Migration Guide and to the 'What's new'.
But I can do it at about my midnight ;)

src/reference/docbook/http.xml
((44 lines not shown))
</para>
-
- <programlisting language="xml"><![CDATA[<bean class="org.springframework.integration.http.inbound.UriPathHandlerMapping"/>]]></programlisting>
+ <programlisting language="xml"><![CDATA[<inbound-gateway id="inboundController"
+ request-channel="requests"
+ reply-channel="responses"
+ view-name="foo"
+ error-code="oops">
+ <request-mapping headers="User-Agent" params="myParam=myValue" consumes="application/json" produces="!text/plain"/>
@ghillert Owner

Add line-break before consumes="application/json". Otherwise it breaks layout in PDF.

@artembilan Collaborator

Thanks, Gunnar!
I forgot to check PDF...
I don't have a lot of free time for immediate polishing, so will be pushed with other potential feedbacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@artembilan
Collaborator

Added 'What's new' commit.

@artembilan
Collaborator

Hi, all!
Guys, will it be merged? Is there any reason to rebase it and polishing docs?

@artembilan
Collaborator

Rebased, polished and added Jackson 2 support.

@ghillert
Owner

@artembilan Can you do me a favor and rebase? THX

@ghillert
Owner

Leaning towards merging, but need to spend some serious time tomorrow (today) reviewing.

@artembilan
Collaborator

Pushed

...tegration/http/config/spring-integration-http-3.0.xsd
((23 lines not shown))
+ <xsd:union memberTypes="httpMethodEnumeration xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="view-name" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation>
+ View name to be resolved when rendering a response.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="view-expression" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation>
+ SpEL expression that resolves to a view to be resolved when rendering a response.
+ The expression can resolve to a view name or View object.
+ In tre case of 'inbound-gateway' the root object of the evaluation context is the reply message.
@ghillert Owner

tre --> the

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
.../inbound/IntegrationRequestMappingHandlerMapping.java
((120 lines not shown))
+ * in the 'parent-child' contexts, e.g. in the Spring-MVC applications.
+ *
+ * @param event - {@link ContextRefreshedEvent} which occurs
+ * after Application context is completely initialized.
+ * @see org.springframework.web.servlet.handler.AbstractHandlerMethodMapping#afterPropertiesSet()
+ */
+ public void onApplicationEvent(ContextRefreshedEvent event) {
+ if (this.getApplicationContext().equals(event.getApplicationContext())) {
+ this.delegate.afterPropertiesSet();
+ }
+ }
+
+ /**
+ * An internal bridge {@link RequestMappingInfoHandlerMapping} implementation.
+ */
+ private class HandlerMappingBridge extends RequestMappingInfoHandlerMapping {
@ghillert Owner

Maybe rename HandlerMappingBridge to HandlerMappingDelegate - then it also fits better with the delegate variable above. Maybe you can also add some JavaDoc explaining why the delegate is necessary in the first place. Took me a minute initially.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
.../inbound/IntegrationRequestMappingHandlerMapping.java
((38 lines not shown))
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * {@link org.springframework.web.servlet.HandlerMapping} implementation that
+ * detects and registers {@link RequestMappingInfo}s for {@link HttpRequestHandlingEndpointSupport}
+ * from a Spring Integration HTTP configuration of
+ * &lt;inbound-channel-adapter&gt; or &lt;inbound-gateway&gt; element.
+ *
+ * @author Artem Bilan
+ *
+ * @see RequestMappingHandlerMapping
+ * @since 3.0
+ */
+public class IntegrationRequestMappingHandlerMapping extends AbstractHandlerMapping
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
...ork/integration/http/config/HttpNamespaceHandler.java
((8 lines not shown))
* @since 1.0.2
*/
public class HttpNamespaceHandler extends AbstractIntegrationNamespaceHandler {
+ /**
+ * @see HttpInboundEndpointParser
+ */
+ public static final String HANDLER_MAPPING_BEAN_NAME = "integrationRequestMappingHandlerMapping";
@ghillert Owner

Not sure if this constant should be defined in here. It feels wrong IMO - as the bean name is not conceptually tied to the XML namespace parsing. If we had a FactoryBean, I think it would be okay to define it there. Or in case of class PollerMetadata, we define:

DEFAULT_POLLER_METADATA_BEAN_NAME = "org.springframework.integration.context.defaultPollerMetadata";

I think the best spot would be a utility class similar to IntegrationContextUtils, either:

HttpIntegrationContextUtils or
HttpContextUtils

Besides the IntegrationContextUtils in core we only have XmppContextUtils as a similar case (Although I would refrain from using an interface ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
.../http/inbound/HttpRequestHandlingEndpointSupport.java
@@ -154,7 +154,10 @@ public HttpRequestHandlingEndpointSupport(boolean expectReply) {
if (jaxb2Present) {
this.messageConverters.add(new Jaxb2RootElementHttpMessageConverter());
}
- if (jacksonPresent) {
+ if (jackson2Present) {
@ghillert Owner

Hasn't been there before - But do you think it might add value to add some debug- or info-level logging here that the respective MessageConverter will be added. While I like implicit magic, I also like to inform users about it :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
.../http/inbound/HttpRequestHandlingEndpointSupport.java
@@ -225,23 +216,16 @@ public void setHeaderMapper(HeaderMapper<HttpHeaders> headerMapper) {
}
/**
- * Specify the supported request method names for this gateway. By default, only GET and POST are supported.
+ * Set the {@link RequestMapping} to allow provide flexible RESTFul-mapping for this endpoint.
+ * See Spring MVC 3.1
*/
@ghillert Owner

Language:

Set the {@link RequestMapping} which allows you to specify a flexible RESTFul-mapping for this endpoint.

I would probably remove the See Spring MVC 3.1 and rather provide more explanations under RequestMapping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
...ramework/integration/http/inbound/RequestMapping.java
((14 lines not shown))
+ * limitations under the License.
+ */
+package org.springframework.integration.http.inbound;
+
+import org.springframework.http.HttpMethod;
+import org.springframework.util.Assert;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+/**
+ * Internal class for mapping web requests onto specific {@link HttpRequestHandlingEndpointSupport}.
+ *
+ * @author Artem Bilan
+ * @see org.springframework.web.bind.annotation.RequestMapping
+ * @since 3.0
+ */
+class RequestMapping {
@ghillert Owner

Could there possibly be made the argument to make this class public? I am thinking of edge-cases where a user would want to configure endpoint using Java only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
...ramework/integration/http/inbound/RequestMapping.java
((9 lines not shown))
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springframework.integration.http.inbound;
+
+import org.springframework.http.HttpMethod;
+import org.springframework.util.Assert;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+/**
+ * Internal class for mapping web requests onto specific {@link HttpRequestHandlingEndpointSupport}.
+ *
@ghillert Owner

Please provide some additional JavaDoc here - explaining the reasoning for this class. It seems to provide basically a direct mapping in terms of functionality compared to Spring MVC's annotation support in org.springframework.web.bind.annotation.RequestMapping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@ghillert
Owner

Also, with the added flexibility, we probably should contrast in the HTTP reference chapter the various options we have for defining Spring Integration flows:

  • Either, do more logic in the Inbound Adapter OR'
  • get the data (Message) into the flow as early as possibly and apply routing and filtering logic then (Usually more recommended)

Therefore, maybe you can incorporate the example given in the forum as a example, so that users are aware of the 2 options.

<channel id="httpMethodRouter"/>

<channel id="out"/>

<http:inbound-gateway request-channel="httpMethodRouter" reply-channel="out" supported-methods="GET,DELETE"
          name="/process/{entId}" path="/process/{entId}" payload-expression="#pathVariables.entId"/>

<router input-channel="httpMethodRouter" expression="headers.http_requestMethod">
    <mapping value="GET" channel="in1"/>
    <mapping value="DELETE" channel="in2"/>
</router>

<channel id="in1"/>

<service-activator input-channel="in1" output-channel="out" ref="service" method="getEntity"/>

<channel id="in2"/>

<service-activator input-channel="in2" output-channel="out"  ref="service" method="delete"/>
@artembilan
Collaborator

Gunnar, thanks!
All reviews will be addressed without any comments: I agree.
I'm not sure still in the extending of RequestMappingHandlerMapping, but I'll take a look too...

@artembilan
Collaborator

Gunnar, I'm not sure in the comment about various techniques in the reference manual.
It should be somewhere as a 'Best practices', or, of course, we can add a sample to our SAMPLES repository and reference to it in the Manual.

@ghillert
Owner

Maybe we just create a separate Jira for that - I would like to add a section regarding that to the HTTP Adapter but also have possibly a global paragraph/chapter on this somewhere.

Giving users advice on the following question: "Have Inbound Adapters do more of the heavy lifting (Conversion etc.)" versus "Do as little processing in the Inbound Adapters in order to get the message as fast as possible in to the SI flow and do routing, transformation, filtering in the SI flow itself."

src/reference/docbook/http.xml
((44 lines not shown))
</para>
-
@ghillert Owner

Please add a not box here - Something like:

Spring Integration 3.0 is improving the REST support by introducing the IntegrationRequestMappingHandlerMapping. The implementation relies on the enhanced REST support provided by Spring Framework 3.1 or higher.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
src/reference/docbook/http.xml
((21 lines not shown))
<para>
- In order to use the <emphasis>HTTP Inbound Gateway</emphasis> or the
- <emphasis>HTTP Inbound Channel Adapter</emphasis> you must define a
-
- <interfacename><ulink url="http://static.springsource.org/spring-integration/api/org/springframework/integration/http/inbound/UriPathHandlerMapping.html"
- >UriPathHandlerMapping</ulink></interfacename>. This particular implementation of the
+ Parsing of the <emphasis>HTTP Inbound Gateway</emphasis> or the
+ <emphasis>HTTP Inbound Channel Adapter</emphasis> registers <code>integrationRequestMappingHandlerMapping</code>
@ghillert Owner

Some wording changes - change:

"registers integrationRequestMappingHandlerMapping bean of type" to
"registers an integrationRequestMappingHandlerMapping bean of type"

if there is no one registered before to
if there is none registered, yet

This particular implementation of the HandlerMapping, which delegates its logic to the RequestMappingInfoHandlerMapping to
This particular implementation of the HandlerMapping delegates its logic to the RequestMappingInfoHandlerMapping

** However IntegrationRequestMappingHandlerMapping, on the configuration phase, to detect and to map Spring Integration HttpRequestHandler and Controller implementations, uses a bit different way in contradistinction to Mapping Requests With @RequestMapping. For this purpose, in conjunction with path and supported-methods attributes on http:inbound-channel-adapter and http:inbound-gateway, there is a nested optional element: ** to

The implementation provides similar functionality as provided by the @RequestMapping annotation in Spring MVC.

Add Info Box: "For more information, please see Mapping Requests With @RequestMapping".

For this purpose, Spring Integration 3.0 introduces the sub-element. This optional sub-element can be added to the http:inbound-channel-adapter and the http:inbound-gateway. It works in conjunction with the *path** and supported-methods attributes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@ghillert ghillert commented on the diff
src/reference/docbook/http.xml
((44 lines not shown))
</para>
-
- <programlisting language="xml"><![CDATA[<bean class="org.springframework.integration.http.inbound.UriPathHandlerMapping"/>]]></programlisting>
+ <programlisting language="xml"><![CDATA[<inbound-gateway id="inboundController"
+ request-channel="requests"
+ reply-channel="responses"
+ path="/foo/{fooId}"
+ supported-methods="GET"
+ view-name="foo"
+ error-code="oops">
+ <request-mapping headers="User-Agent"
+ params="myParam=myValue"
+ consumes="application/json"
+ produces="!text/plain"/>
@ghillert Owner

Please list all available request-mapping attributes explicitly. Something like (rephrased the paragraph a bit - hope it flows):

Based on this configuration, the parser creates an instance of the IntegrationRequestMappingHandlerMapping (if none exist, yet). During the configuration phase a Spring Integration-internal RequestMapping is created, which in turn is converted to Spring MVC's RequestMappingInfo.

The request-mapping sub-element provides the following attributes:

  • headers
  • params
  • consumes
  • produces

These attributes translate directly into the respective options provided by the @RequestMapping annotation in Spring MVC. For more information regarding Handler Mappings, please see:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@artembilan
Collaborator

Guys, I've decided to save a bit your time and show you what I've got now.
See the last commit.

@garyrussell
Owner

Hi Gunnar, can you give this some attention after SpringOne? It looks like you were pretty close to merging it.

Thanks,

@artembilan
Collaborator

Pushed after rebase

@artembilan
Collaborator

Pushed new commit:

  • Fix XSD docs
  • Some polishing
  • Test for case 'Multiple paths - the same endpoint'
@artembilan
Collaborator

Applied @bijukunjummen patch regarding using JacksonJsonUtils in the HttpRequestHandlingEndpointSupport

@artembilan
Collaborator

This PR depends on #881 and shuld be rebased and polished after merge the last one

@ghillert
Owner

@artembilan looks like #881 is merged. Please rebase this PR and I can sprinkle my holy water on it ;-)

@artembilan
Collaborator

Thanks, Gunnar! but unfortunately, not today.

@artembilan
Collaborator

Rebased and polished

@ghillert
Owner

Darn - @artembilan Was about to finally merge this - can you do one more rebase on this one? THANKS!

...ntegration/http/config/HttpInboundEndpointParser.java
((31 lines not shown))
/**
* Parser for the 'inbound-channel-adapter' and 'inbound-gateway' elements
* of the 'http' namespace. The constructor's boolean value specifies whether
* a reply is to be expected. This value should be 'false' for the
* 'inbound-channel-adapter' and 'true' for the 'inbound-gateway'.
+ * As well as this parser register global Spring-MVC infrastructure bean for
+ * {@link IntegrationRequestMappingHandlerMapping};
+ * see {@link #registerRequestMappingHandlerMappingIfNecessary}.
*
@ghillert Owner

I think you meant:

This parser also registers a global Spring-MVC infrastructure bean for {@link IntegrationRequestMappingHandlerMapping} if it does not exist in the application context using the bean name {@link HttpContextUtils#HANDLER_MAPPING_BEAN_NAME}.

@artembilan Collaborator

Hi, Gunnar!
Thank you for your feadbacks.
Here I want mind and can change it, but somedays Oleg or Gary pointed me out that JavaDoc should be more formal and as less as possible.
IMO see {@link #registerRequestMappingHandlerMappingIfNecessary} is just enough.
I'm waiting more comments and fixing them, if needed.
Let me know when there won't be more concerns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
.../http/inbound/HttpRequestHandlingEndpointSupport.java
((18 lines not shown))
/**
* Base class for HTTP request handling endpoints.
* <p>
- * By default GET and POST requests are accepted, but the 'supportedMethods' property may be set to include others or
- * limit the options (e.g. POST only). A GET request will generate a payload containing its 'parameterMap' while a POST
+ * By default GET and POST requests are accepted via supplied default instance of {@link RequestMapping}.
@ghillert Owner

via a supplied

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
.../http/inbound/HttpRequestHandlingEndpointSupport.java
((21 lines not shown))
}
/**
* Specify the supported request methods for this gateway. By default, only GET and POST are supported.
+ * @deprecated in favor to {@linkplain #requestMapping}
@ghillert Owner

We don't do it in many place, but I wonder if it might be useful to state the version number that started deprecating this property, e.g. Since 3.0...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
.../inbound/IntegrationRequestMappingHandlerMapping.java
((29 lines not shown))
+import org.springframework.web.servlet.HandlerExecutionChain;
+import org.springframework.web.servlet.mvc.condition.RequestCondition;
+import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
+import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
+
+/**
+ * The {@link org.springframework.web.servlet.HandlerMapping} implementation that
+ * detects and registers {@link RequestMappingInfo}s for {@link HttpRequestHandlingEndpointSupport}
+ * from a Spring Integration HTTP configuration of
+ * {@code <inbound-channel-adapter/>} and {@code <inbound-gateway/>} elements.
+ * <p/>
+ * This class is automatically configured as bean in the application context on the parsing phase of
+ * the {@code <inbound-channel-adapter/>} and {@code <inbound-gateway/>} elements, if there is none registered, yet.
+ * However it can be configured as a regular bean with appropriate configuration for
+ * {@link RequestMappingHandlerMapping}. It is recommended to have only one similar bean in the application context
+ * and with the 'id' {@link org.springframework.integration.http.support.HttpContextUtils#HANDLER_MAPPING_BEAN_NAME}.
@ghillert Owner

and with the 'id' --> using the 'id'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
.../inbound/IntegrationRequestMappingHandlerMapping.java
((32 lines not shown))
+import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
+
+/**
+ * The {@link org.springframework.web.servlet.HandlerMapping} implementation that
+ * detects and registers {@link RequestMappingInfo}s for {@link HttpRequestHandlingEndpointSupport}
+ * from a Spring Integration HTTP configuration of
+ * {@code <inbound-channel-adapter/>} and {@code <inbound-gateway/>} elements.
+ * <p/>
+ * This class is automatically configured as bean in the application context on the parsing phase of
+ * the {@code <inbound-channel-adapter/>} and {@code <inbound-gateway/>} elements, if there is none registered, yet.
+ * However it can be configured as a regular bean with appropriate configuration for
+ * {@link RequestMappingHandlerMapping}. It is recommended to have only one similar bean in the application context
+ * and with the 'id' {@link org.springframework.integration.http.support.HttpContextUtils#HANDLER_MAPPING_BEAN_NAME}.
+ * <p/>
+ * In most cases Spring MVC offers to configure Request Mapping via {@link org.springframework.stereotype.Controller}
+ * and {@link org.springframework.web.bind.annotation.RequestMapping},
@ghillert Owner

Change:
and {@link org.springframework.web.bind.annotation.RequestMapping},

To:
and {@link org.springframework.web.bind.annotation.RequestMapping}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
.../inbound/IntegrationRequestMappingHandlerMapping.java
((33 lines not shown))
+
+/**
+ * The {@link org.springframework.web.servlet.HandlerMapping} implementation that
+ * detects and registers {@link RequestMappingInfo}s for {@link HttpRequestHandlingEndpointSupport}
+ * from a Spring Integration HTTP configuration of
+ * {@code <inbound-channel-adapter/>} and {@code <inbound-gateway/>} elements.
+ * <p/>
+ * This class is automatically configured as bean in the application context on the parsing phase of
+ * the {@code <inbound-channel-adapter/>} and {@code <inbound-gateway/>} elements, if there is none registered, yet.
+ * However it can be configured as a regular bean with appropriate configuration for
+ * {@link RequestMappingHandlerMapping}. It is recommended to have only one similar bean in the application context
+ * and with the 'id' {@link org.springframework.integration.http.support.HttpContextUtils#HANDLER_MAPPING_BEAN_NAME}.
+ * <p/>
+ * In most cases Spring MVC offers to configure Request Mapping via {@link org.springframework.stereotype.Controller}
+ * and {@link org.springframework.web.bind.annotation.RequestMapping},
+ * and that's why Spring MVC Handler Mapping infrastructure relies on {@link org.springframework.web.method.HandlerMethod},
@ghillert Owner

That's why Spring MVC's Handler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
.../inbound/IntegrationRequestMappingHandlerMapping.java
((34 lines not shown))
+/**
+ * The {@link org.springframework.web.servlet.HandlerMapping} implementation that
+ * detects and registers {@link RequestMappingInfo}s for {@link HttpRequestHandlingEndpointSupport}
+ * from a Spring Integration HTTP configuration of
+ * {@code <inbound-channel-adapter/>} and {@code <inbound-gateway/>} elements.
+ * <p/>
+ * This class is automatically configured as bean in the application context on the parsing phase of
+ * the {@code <inbound-channel-adapter/>} and {@code <inbound-gateway/>} elements, if there is none registered, yet.
+ * However it can be configured as a regular bean with appropriate configuration for
+ * {@link RequestMappingHandlerMapping}. It is recommended to have only one similar bean in the application context
+ * and with the 'id' {@link org.springframework.integration.http.support.HttpContextUtils#HANDLER_MAPPING_BEAN_NAME}.
+ * <p/>
+ * In most cases Spring MVC offers to configure Request Mapping via {@link org.springframework.stereotype.Controller}
+ * and {@link org.springframework.web.bind.annotation.RequestMapping},
+ * and that's why Spring MVC Handler Mapping infrastructure relies on {@link org.springframework.web.method.HandlerMethod},
+ * because different methods at the same {@link org.springframework.stereotype.Controller} user-class may have its own
@ghillert Owner

as different methods
may have their own

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
.../inbound/IntegrationRequestMappingHandlerMapping.java
((35 lines not shown))
+ * The {@link org.springframework.web.servlet.HandlerMapping} implementation that
+ * detects and registers {@link RequestMappingInfo}s for {@link HttpRequestHandlingEndpointSupport}
+ * from a Spring Integration HTTP configuration of
+ * {@code <inbound-channel-adapter/>} and {@code <inbound-gateway/>} elements.
+ * <p/>
+ * This class is automatically configured as bean in the application context on the parsing phase of
+ * the {@code <inbound-channel-adapter/>} and {@code <inbound-gateway/>} elements, if there is none registered, yet.
+ * However it can be configured as a regular bean with appropriate configuration for
+ * {@link RequestMappingHandlerMapping}. It is recommended to have only one similar bean in the application context
+ * and with the 'id' {@link org.springframework.integration.http.support.HttpContextUtils#HANDLER_MAPPING_BEAN_NAME}.
+ * <p/>
+ * In most cases Spring MVC offers to configure Request Mapping via {@link org.springframework.stereotype.Controller}
+ * and {@link org.springframework.web.bind.annotation.RequestMapping},
+ * and that's why Spring MVC Handler Mapping infrastructure relies on {@link org.springframework.web.method.HandlerMethod},
+ * because different methods at the same {@link org.springframework.stereotype.Controller} user-class may have its own
+ * {@link org.springframework.web.bind.annotation.RequestMapping}. From other side all Spring Integration HTTP Inbound
@ghillert Owner

On the other side , ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
.../inbound/IntegrationRequestMappingHandlerMapping.java
((37 lines not shown))
+ * from a Spring Integration HTTP configuration of
+ * {@code <inbound-channel-adapter/>} and {@code <inbound-gateway/>} elements.
+ * <p/>
+ * This class is automatically configured as bean in the application context on the parsing phase of
+ * the {@code <inbound-channel-adapter/>} and {@code <inbound-gateway/>} elements, if there is none registered, yet.
+ * However it can be configured as a regular bean with appropriate configuration for
+ * {@link RequestMappingHandlerMapping}. It is recommended to have only one similar bean in the application context
+ * and with the 'id' {@link org.springframework.integration.http.support.HttpContextUtils#HANDLER_MAPPING_BEAN_NAME}.
+ * <p/>
+ * In most cases Spring MVC offers to configure Request Mapping via {@link org.springframework.stereotype.Controller}
+ * and {@link org.springframework.web.bind.annotation.RequestMapping},
+ * and that's why Spring MVC Handler Mapping infrastructure relies on {@link org.springframework.web.method.HandlerMethod},
+ * because different methods at the same {@link org.springframework.stereotype.Controller} user-class may have its own
+ * {@link org.springframework.web.bind.annotation.RequestMapping}. From other side all Spring Integration HTTP Inbound
+ * Endpoints are configured on the basis of the same {@link HttpRequestHandlingEndpointSupport} class and there is no
+ * any {@link RequestMappingInfo} configuration without {@link org.springframework.web.method.HandlerMethod} in the Spring MVC.
@ghillert Owner

I think you meant there is no single ...
Also: in Spring MVC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
.../inbound/IntegrationRequestMappingHandlerMapping.java
((38 lines not shown))
+ * {@code <inbound-channel-adapter/>} and {@code <inbound-gateway/>} elements.
+ * <p/>
+ * This class is automatically configured as bean in the application context on the parsing phase of
+ * the {@code <inbound-channel-adapter/>} and {@code <inbound-gateway/>} elements, if there is none registered, yet.
+ * However it can be configured as a regular bean with appropriate configuration for
+ * {@link RequestMappingHandlerMapping}. It is recommended to have only one similar bean in the application context
+ * and with the 'id' {@link org.springframework.integration.http.support.HttpContextUtils#HANDLER_MAPPING_BEAN_NAME}.
+ * <p/>
+ * In most cases Spring MVC offers to configure Request Mapping via {@link org.springframework.stereotype.Controller}
+ * and {@link org.springframework.web.bind.annotation.RequestMapping},
+ * and that's why Spring MVC Handler Mapping infrastructure relies on {@link org.springframework.web.method.HandlerMethod},
+ * because different methods at the same {@link org.springframework.stereotype.Controller} user-class may have its own
+ * {@link org.springframework.web.bind.annotation.RequestMapping}. From other side all Spring Integration HTTP Inbound
+ * Endpoints are configured on the basis of the same {@link HttpRequestHandlingEndpointSupport} class and there is no
+ * any {@link RequestMappingInfo} configuration without {@link org.springframework.web.method.HandlerMethod} in the Spring MVC.
+ * Accordingly {@link IntegrationRequestMappingHandlerMapping} is some {@link org.springframework.web.servlet.HandlerMapping}
@ghillert Owner

is a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
.../inbound/IntegrationRequestMappingHandlerMapping.java
((39 lines not shown))
+ * <p/>
+ * This class is automatically configured as bean in the application context on the parsing phase of
+ * the {@code <inbound-channel-adapter/>} and {@code <inbound-gateway/>} elements, if there is none registered, yet.
+ * However it can be configured as a regular bean with appropriate configuration for
+ * {@link RequestMappingHandlerMapping}. It is recommended to have only one similar bean in the application context
+ * and with the 'id' {@link org.springframework.integration.http.support.HttpContextUtils#HANDLER_MAPPING_BEAN_NAME}.
+ * <p/>
+ * In most cases Spring MVC offers to configure Request Mapping via {@link org.springframework.stereotype.Controller}
+ * and {@link org.springframework.web.bind.annotation.RequestMapping},
+ * and that's why Spring MVC Handler Mapping infrastructure relies on {@link org.springframework.web.method.HandlerMethod},
+ * because different methods at the same {@link org.springframework.stereotype.Controller} user-class may have its own
+ * {@link org.springframework.web.bind.annotation.RequestMapping}. From other side all Spring Integration HTTP Inbound
+ * Endpoints are configured on the basis of the same {@link HttpRequestHandlingEndpointSupport} class and there is no
+ * any {@link RequestMappingInfo} configuration without {@link org.springframework.web.method.HandlerMethod} in the Spring MVC.
+ * Accordingly {@link IntegrationRequestMappingHandlerMapping} is some {@link org.springframework.web.servlet.HandlerMapping}
+ * compromise implementation between method-level annotation and component-level (e.g. Spring Integration XML) configurations.
@ghillert Owner

annotations and component-level (Spring Integration XML) configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
...ramework/integration/http/inbound/RequestMapping.java
((14 lines not shown))
+ * limitations under the License.
+ */
+package org.springframework.integration.http.inbound;
+
+import org.springframework.http.HttpMethod;
+import org.springframework.util.Assert;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+/**
+ * Class for mapping web requests onto specific {@link HttpRequestHandlingEndpointSupport}.
+ * Provides direct mapping in terms of functionality compared to
+ * {@link org.springframework.web.bind.annotation.RequestMapping}.
+ * <p>
+ * Through the {@link IntegrationRequestMappingHandlerMapping}'s 'detect handler method' process is converted
+ * to the {@link org.springframework.web.servlet.mvc.method.RequestMappingInfo}, which is used in the Spring MVC
+ * {@link org.springframework.web.servlet.HandlerMapping} infrastructure.
@ghillert Owner

I had a tricky time understanding this paragraph - maybe rephrase.

@artembilan Collaborator

I'll remove it and add @see IntegrationRequestMappingHandlerMapping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
artembilan and others added some commits
@artembilan artembilan INT-2312: HTTP RequestMapping support
The general idea to use Spring-MVC as much as possible.

* introduce `RequestMapping`, `IntegrationRequestMappingHandlerMapping`
* introduce XSD nested element `<request-mapping>` for HTTP Inbound Endpoints
* introduce `inboundCommonAttributes` XSD attributeGroup for HTTP Inbound Endpoints
* introduce `IntegrationNamespaceUtils#createExpressionDefIfAttributeDefined` & `IntegrationNamespaceUtils#createDirectChannel`
* remove deprecated `name` attribute
* remove `UriPathHandlerMapping` as superseded by `IntegrationRequestMappingHandlerMapping`

JIRA: https://jira.springsource.org/browse/INT-2312, https://jira.springsource.org/browse/INT-2619
1b80dc9
@artembilan artembilan INT-2528: Remove deprecations in HTTP module e3af1df
@artembilan artembilan INT-2312: Doc for `<request-mapping>`
* Add description to Reference Manual about `<request-mapping>`
* Additional doc polishing
* Add additional test for `<request-mapping>`
* Polishing according PR's comments
1cce820
@artembilan artembilan INT-2312: 'What's new' and http doc polishing b52dfa1
@artembilan artembilan INT-2312: Add Jackson 2 support for HTTP-inbound a3859af
@artembilan artembilan INT-2312: Rebase polishing d6995cd
@artembilan artembilan INT-2312: Review & email discussion polishing
* Make `RequestMapping` public
* Introduce `HttpContextUtils` and move `HANDLER_MAPPING_BEAN_NAME` to it
* Revert and deprecate public API
* Improve JavaDocs
* Improve Reference Manual
* Rework `IntegrationRequestMappingHandlerMapping` according to email discussion
05615f5
@artembilan artembilan INT-2312: Polishing after rebase 8d9cf28
Artem Bilan INT-2312: Docs polishing and tests 8804206
@bijukunjummen bijukunjummen Using Jackson 2 HttpMessageConverter if Jackson 2 is available in cla…
…sspath
e850d44
Artem Bilan Apply Biju Kunjummen commit 6f9d800
Artem Bilan INT-2312: Polishing after rebase 61afaae
@artembilan
Collaborator

OK, pushed polishing

...tegration/http/config/spring-integration-http-3.0.xsd
@@ -23,151 +24,12 @@
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
- <xsd:element name="header" type="headerType" minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="request-mapping" type="requestMappingType" minOccurs="0"/>
+ <xsd:element name="header" type="headerType" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
@ghillert Owner

@artembilan Could you do me a huge favor? As you made a few changes to the schema, can you make sure that each adapter-element, attribute and adapter sub-element has documentation that shows up in STS?

For example the sub-elements request-mapping and header have no documentation showing up. In fact the inbound-channel-adapter has no documentation showing up itself. E.g.

<xsd:annotation>
    <xsd:documentation>
        Defines an inbound HTTP-based Channel Adapter.
    </xsd:documentation>
</xsd:annotation>

Should be moved before complexType. The inbound-gateway is not showing up either. As you did such a significant refactoring, I wonder if we could just use the opportunity and also fix the schema documentation :-)

@artembilan Collaborator

NP, will be done, but already not today.
BTW, requestMappingType has doc. Is it shown for you in STS?

@garyrussell Owner

Not in my STS - the docs for the the <request-mapping/> element shows up blank.

@artembilan Collaborator

So, sounds like there is no reason document types and groups. And document real elements and attributes

@artembilan Collaborator

Hi there!
BTW, re. popup docs. IDEA does well via Ctrl+Q on element or attribute:
xsd_javadocs
I see it without polishing docs of that XSD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@ghillert ghillert commented on the diff
...tegration/http/config/spring-integration-http-3.0.xsd
((97 lines not shown))
+ </tool:annotation>
+ </xsd:appinfo>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="mapped-request-headers" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation><![CDATA[
+ Comma-separated list of names of HttpHeaders to be mapped from the HTTP request into the MessageHeaders.
+ This can only be provided if the 'header-mapper' reference is not being set directly. The values in
+ this list can also be simple patterns to be matched against the header names (e.g. "foo*" or "*foo").
+ The String "HTTP_REQUEST_HEADERS" will match against any of the standard HTTP Request headers.
+ ]]></xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="error-channel" type="xsd:string">
+ <xsd:annotation>
@ghillert Owner

no doc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@ghillert ghillert commented on the diff
...tegration/http/config/spring-integration-http-3.0.xsd
((77 lines not shown))
+ List of HttpMessageConverters for this Channel Adapter.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="merge-with-default-converters" type="xsd:boolean" default="false">
+ <xsd:annotation>
+ <xsd:documentation>
+ Flag to indicate if the default converters should be registered after any custom
+ converters. This flag is used only if message-converters
+ are provided, otherwise all default converters will be registered.
+
+ Defaults to "false"
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="header-mapper" type="xsd:string">
@ghillert Owner

no doc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
...tegration/http/config/spring-integration-http-3.0.xsd
((19 lines not shown))
-
- This bean is used by the Spring MVC DispatcherServlet
- to evaluate which URL maps to which inbound endpoint.
- For more information please see the chapter on
- 'Handler mappings' in the Spring Framework Reference
- Documentation.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="request-payload-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>
- Target type for payload that is the conversion result of the request.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
<xsd:attribute name="send-timeout" type="xsd:string" />
@ghillert Owner

no doc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@ghillert ghillert commented on the diff
...tegration/http/config/spring-integration-http-3.0.xsd
@@ -373,6 +111,124 @@ The String "HTTP_REQUEST_HEADERS" will match against any of the standard HTTP Re
</xsd:complexType>
</xsd:element>
+ <xsd:attributeGroup name="inboundCommonAttributes">
+ <xsd:attribute name="path" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation>
+ Comma-separated URI paths (e.g., /orderId/{order}).
+ Ant-style path patterns are also supported (e.g. /myPath/*.do).
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="supported-methods">
@ghillert Owner

no doc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
...und/Int2312RequestMappingIntegrationTests-context.xml
((5 lines not shown))
+ xmlns:util="http://www.springframework.org/schema/util"
+ xmlns:si="http://www.springframework.org/schema/integration"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/util
+ http://www.springframework.org/schema/util/spring-util.xsd
+ http://www.springframework.org/schema/integration
+ http://www.springframework.org/schema/integration/spring-integration.xsd
+ http://www.springframework.org/schema/integration/http
+ http://www.springframework.org/schema/integration/http/spring-integration-http.xsd">
+
+ <inbound-gateway path="/path1,/path2"
+ request-channel="multiplePathsChannel"/>
+
+ <si:transformer input-channel="multiplePathsChannel"
+ expression="T(org.springframework.integration.http.inbound.Int2312RequestMappingIntegrationTests).TEST_STRING_MULTIPLE_PATHS"/>
@ghillert Owner

A little nit-picky, but for new spring integration context files, could you use the int: and int-http: namespace prefixes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
src/reference/docbook/http.xml
((19 lines not shown))
- <para><emphasis>Defining the UriPathHandlerMapping</emphasis></para>
-
- <para>
- In order to use the <emphasis>HTTP Inbound Gateway</emphasis> or the
- <emphasis>HTTP Inbound Channel Adapter</emphasis> you must define a
-
- <interfacename><ulink url="http://static.springsource.org/spring-integration/api/org/springframework/integration/http/inbound/UriPathHandlerMapping.html"
- >UriPathHandlerMapping</ulink></interfacename>. This particular implementation of the
- <ulink url="http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/web/servlet/HandlerMapping.html"
- ><interfacename>HandlerMapping</interfacename></ulink> matches against
- the value of the <emphasis>path</emphasis> attribute.
+
+ <para><emphasis>Request Mapping support</emphasis></para>
+
+ <para>
+ <note>
@ghillert Owner

<note> should be outside the <para> tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
src/reference/docbook/http.xml
((42 lines not shown))
<para>
- For more information regarding <emphasis>Handler Mappings</emphasis>, please
- see:
+ Parsing of the <emphasis>HTTP Inbound Gateway</emphasis> or the
+ <emphasis>HTTP Inbound Channel Adapter</emphasis> registers an <code>integrationRequestMappingHandlerMapping</code>
+ bean of type
+ <interfacename><ulink url="http://static.springsource.org/spring-integration/api/org/springframework/integration/http/inbound/IntegrationRequestMappingHandlerMapping.html"
+ >IntegrationRequestMappingHandlerMapping</ulink></interfacename>, if there is none registered, yet. This particular implementation of the
+ <ulink url="http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/web/servlet/HandlerMapping.html"
+ ><interfacename>HandlerMapping</interfacename></ulink> delegates its logic to the
+ <ulink url="http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/web/servlet/mvc/method/RequestMappingInfoHandlerMapping.html"
+ ><interfacename>RequestMappingInfoHandlerMapping</interfacename></ulink>. The implementation provides similar functionality as provided by the
+ <ulink url="http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/web/bind/annotation/RequestMapping.html"
+ ><classname>org.springframework.web.bind.annotation.RequestMapping</classname></ulink> annotation in Spring MVC.
+ <note>
@ghillert Owner

place a </para> before the note.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
src/reference/docbook/http.xml
((46 lines not shown))
+ <emphasis>HTTP Inbound Channel Adapter</emphasis> registers an <code>integrationRequestMappingHandlerMapping</code>
+ bean of type
+ <interfacename><ulink url="http://static.springsource.org/spring-integration/api/org/springframework/integration/http/inbound/IntegrationRequestMappingHandlerMapping.html"
+ >IntegrationRequestMappingHandlerMapping</ulink></interfacename>, if there is none registered, yet. This particular implementation of the
+ <ulink url="http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/web/servlet/HandlerMapping.html"
+ ><interfacename>HandlerMapping</interfacename></ulink> delegates its logic to the
+ <ulink url="http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/web/servlet/mvc/method/RequestMappingInfoHandlerMapping.html"
+ ><interfacename>RequestMappingInfoHandlerMapping</interfacename></ulink>. The implementation provides similar functionality as provided by the
+ <ulink url="http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/web/bind/annotation/RequestMapping.html"
+ ><classname>org.springframework.web.bind.annotation.RequestMapping</classname></ulink> annotation in Spring MVC.
+ <note>
+ For more information, please see
+ <ulink url="http://static.springsource.org/spring/docs/current/spring-framework-reference/html/mvc.html#mvc-ann-requestmapping">Mapping Requests With @RequestMapping</ulink>.
+ </note>
+
+ For this purpose, Spring Integration 3.0 introduces the <code>&lt;request-mapping&gt;</code> sub-element.
@ghillert Owner

place a after the note.

@ghillert Owner

I usually tend to wrap product names in <emphasis>Spring Integration 3.0</emphasis>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
src/reference/docbook/http.xml
((97 lines not shown))
+ <listitem>
+ produces
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ With the <code>path</code> and <code>supported-methods</code> attributes of the <code>&lt;http:inbound-channel-adapter&gt;</code> or
+ the <code>&lt;http:inbound-gateway&gt;</code> <code>&lt;request-mapping&gt;</code> attributes translate directly into the respective options
+ provided by the <classname>org.springframework.web.bind.annotation.RequestMapping</classname> annotation in Spring MVC.
+ </para>
+ <para>
+ The <code>&lt;request-mapping&gt;</code> allows to configure several Spring Integration HTTP Inbound Endpoints to the same <code>path</code>
+ (or even the same <code>supported-methods</code>) and to provide different downstream message flows based on incoming HTTP Request.
+ </para>
+ <para>
+ However you always can get the data from <interfacename>Message</interfacename> into the flow as early as possibly
@ghillert Owner

Alternatively, you can also declare just one HTTP Inbound Endpoint and apply routing and filtering logic within the Spring Integration flow to achieve the same result. This allows you to get the Message into the flow as early as possibly, e.g.:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
src/reference/docbook/http.xml
((100 lines not shown))
+ </itemizedlist>
+ </para>
+ <para>
+ With the <code>path</code> and <code>supported-methods</code> attributes of the <code>&lt;http:inbound-channel-adapter&gt;</code> or
+ the <code>&lt;http:inbound-gateway&gt;</code> <code>&lt;request-mapping&gt;</code> attributes translate directly into the respective options
+ provided by the <classname>org.springframework.web.bind.annotation.RequestMapping</classname> annotation in Spring MVC.
+ </para>
+ <para>
+ The <code>&lt;request-mapping&gt;</code> allows to configure several Spring Integration HTTP Inbound Endpoints to the same <code>path</code>
+ (or even the same <code>supported-methods</code>) and to provide different downstream message flows based on incoming HTTP Request.
+ </para>
+ <para>
+ However you always can get the data from <interfacename>Message</interfacename> into the flow as early as possibly
+ and apply routing and filtering logic then, e.g.:
+ </para>
+ <programlisting language="xml"><![CDATA[<http:inbound-gateway request-channel="httpMethodRouter"
@ghillert Owner

for the code samples in the doc - could we use the convention int-http: and int:?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
src/reference/docbook/whats-new.xml
@@ -119,6 +119,18 @@
For more information see <xref linkend="spel-property-accessors" />.
</para>
</section>
+ <section id="3.0-request-mapping">
+ <title>HTTP Request Mapping</title>
+ <para>
+ HTTP module provides a powerful Request Mapping for inbound endpoints. <classname>UriPathHandlerMapping</classname>
@ghillert Owner

The HTTP module provides powerful Request Mapping support for inbound endpoints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
src/reference/docbook/whats-new.xml
@@ -119,6 +119,18 @@
For more information see <xref linkend="spel-property-accessors" />.
</para>
</section>
+ <section id="3.0-request-mapping">
+ <title>HTTP Request Mapping</title>
+ <para>
+ HTTP module provides a powerful Request Mapping for inbound endpoints. <classname>UriPathHandlerMapping</classname>
+ was replaced by <classname>IntegrationRequestMappingHandlerMapping</classname>, which is registered as a bean with name
@ghillert Owner

which is registered under the bean name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
src/reference/docbook/whats-new.xml
@@ -119,6 +119,18 @@
For more information see <xref linkend="spel-property-accessors" />.
</para>
</section>
+ <section id="3.0-request-mapping">
+ <title>HTTP Request Mapping</title>
+ <para>
+ HTTP module provides a powerful Request Mapping for inbound endpoints. <classname>UriPathHandlerMapping</classname>
+ was replaced by <classname>IntegrationRequestMappingHandlerMapping</classname>, which is registered as a bean with name
+ <code>integrationRequestMappingHandlerMapping</code> in the application context on parsing of http inbound endpoint,
@ghillert Owner

Maybe break this sentence up into 2:
...in the application context. Upon parsing of the HTTP Inbound Endpoint, a new IntegrationRequestMappingHandlerMapping bean is either registered or an existing bean is being reused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
src/reference/docbook/whats-new.xml
@@ -119,6 +119,18 @@
For more information see <xref linkend="spel-property-accessors" />.
</para>
</section>
+ <section id="3.0-request-mapping">
+ <title>HTTP Request Mapping</title>
+ <para>
+ HTTP module provides a powerful Request Mapping for inbound endpoints. <classname>UriPathHandlerMapping</classname>
+ was replaced by <classname>IntegrationRequestMappingHandlerMapping</classname>, which is registered as a bean with name
+ <code>integrationRequestMappingHandlerMapping</code> in the application context on parsing of http inbound endpoint,
+ if there wasn't registered one before. To achieve flexible Request Mapping is provided <code>&lt;request-mapping/&gt;</code>
+ sub-element for <code>&lt;http:inbound-channel-adapter/&gt;</code> and <code>&lt;http:inbound-gateway/&gt;</code>.
@ghillert Owner

Rephrase:
To achieve flexible Request Mapping configuration, Spring Integration provides the <request-mapping/> sub-element ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
src/reference/docbook/whats-new.xml
@@ -119,6 +119,18 @@
For more information see <xref linkend="spel-property-accessors" />.
</para>
</section>
+ <section id="3.0-request-mapping">
+ <title>HTTP Request Mapping</title>
+ <para>
+ HTTP module provides a powerful Request Mapping for inbound endpoints. <classname>UriPathHandlerMapping</classname>
+ was replaced by <classname>IntegrationRequestMappingHandlerMapping</classname>, which is registered as a bean with name
+ <code>integrationRequestMappingHandlerMapping</code> in the application context on parsing of http inbound endpoint,
+ if there wasn't registered one before. To achieve flexible Request Mapping is provided <code>&lt;request-mapping/&gt;</code>
+ sub-element for <code>&lt;http:inbound-channel-adapter/&gt;</code> and <code>&lt;http:inbound-gateway/&gt;</code>.
+ Both new components are fully based on the Request Mapping infrastructure from Spring MVC 3.1.
@ghillert Owner

Both HTTP Inbound Endpoints are now fully based on the Request Mapping infrastructure that was introduced with Spring MVC 3.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@artembilan
Collaborator

Pushed

@ghillert
Owner

Merged - Minor doc polishing and removing some whitespace.

@ghillert ghillert closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 30, 2013
  1. @artembilan

    INT-2312: HTTP RequestMapping support

    artembilan authored Artem Bilan committed
    The general idea to use Spring-MVC as much as possible.
    
    * introduce `RequestMapping`, `IntegrationRequestMappingHandlerMapping`
    * introduce XSD nested element `<request-mapping>` for HTTP Inbound Endpoints
    * introduce `inboundCommonAttributes` XSD attributeGroup for HTTP Inbound Endpoints
    * introduce `IntegrationNamespaceUtils#createExpressionDefIfAttributeDefined` & `IntegrationNamespaceUtils#createDirectChannel`
    * remove deprecated `name` attribute
    * remove `UriPathHandlerMapping` as superseded by `IntegrationRequestMappingHandlerMapping`
    
    JIRA: https://jira.springsource.org/browse/INT-2312, https://jira.springsource.org/browse/INT-2619
  2. @artembilan

    INT-2528: Remove deprecations in HTTP module

    artembilan authored Artem Bilan committed
  3. @artembilan

    INT-2312: Doc for `<request-mapping>`

    artembilan authored Artem Bilan committed
    * Add description to Reference Manual about `<request-mapping>`
    * Additional doc polishing
    * Add additional test for `<request-mapping>`
    * Polishing according PR's comments
  4. @artembilan

    INT-2312: 'What's new' and http doc polishing

    artembilan authored Artem Bilan committed
  5. @artembilan

    INT-2312: Add Jackson 2 support for HTTP-inbound

    artembilan authored Artem Bilan committed
  6. @artembilan

    INT-2312: Rebase polishing

    artembilan authored Artem Bilan committed
  7. @artembilan

    INT-2312: Review & email discussion polishing

    artembilan authored Artem Bilan committed
    * Make `RequestMapping` public
    * Introduce `HttpContextUtils` and move `HANDLER_MAPPING_BEAN_NAME` to it
    * Revert and deprecate public API
    * Improve JavaDocs
    * Improve Reference Manual
    * Rework `IntegrationRequestMappingHandlerMapping` according to email discussion
  8. @artembilan

    INT-2312: Polishing after rebase

    artembilan authored Artem Bilan committed
  9. INT-2312: Docs polishing and tests

    Artem Bilan authored
  10. @bijukunjummen

    Using Jackson 2 HttpMessageConverter if Jackson 2 is available in cla…

    bijukunjummen authored Artem Bilan committed
    …sspath
  11. Apply Biju Kunjummen commit

    Artem Bilan authored
  12. INT-2312: Polishing after rebase

    Artem Bilan authored
  13. INT-2312: Polishing

    Artem Bilan authored
Commits on Oct 1, 2013
  1. INT-2312: Polishing docs and XSD

    Artem Bilan authored
Something went wrong with that request. Please try again.