or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

configuration.mdinbound-endpoints.mdindex.mdjava-dsl.mdmanagement.mdmessage-conversion.mdmultipart-handling.mdoutbound-handlers.md
tile.json

inbound-endpoints.mddocs/

HTTP Inbound Endpoints

Components for receiving HTTP requests and converting them to Spring Integration messages. Inbound endpoints integrate with Spring MVC's DispatcherServlet and support flexible request mapping, message conversion, header mapping, CORS configuration, and payload validation.

Key Information for Agents

Required Dependencies:

  • spring-webmvc or spring-webflux must be on classpath for inbound endpoints to work
  • spring-integration-core is required
  • Spring MVC DispatcherServlet must be configured

Default Behaviors:

  • expectReply=true by default (request-reply pattern)
  • Request channel is required; reply channel is optional (uses temporary channel if not set)
  • RequestMapping must be configured or endpoint won't be registered
  • Default message converters: JSON, XML, String, Form (via RestTemplate defaults)
  • No CORS by default (must be explicitly configured)
  • No validation by default (must be explicitly configured)
  • extractReplyPayload=true by default (only payload in response, not full Message)
  • convertExceptions=false by default (exceptions propagate to servlet container)

Threading Model:

  • Requests handled on servlet container thread pool
  • Synchronous by default (blocks until reply received)
  • For async processing, use async channels (ExecutorChannel, QueueChannel)
  • beforeShutdown() and afterShutdown() support graceful shutdown

Lifecycle:

  • Endpoints registered automatically when bean is initialized
  • Registration happens via DynamicRequestMappingBeanPostProcessor
  • Endpoints unregistered when bean is destroyed
  • Handler mapping scans for endpoints on ContextRefreshedEvent

Exceptions:

  • IntegrationWebExchangeBindException - validation failures
  • HttpMessageNotReadableException - request body conversion failures
  • HttpMessageNotWritableException - response body conversion failures
  • ServletException, IOException - servlet-level errors

Edge Cases:

  • If expectReply=false and no reply channel set, gateway returns immediately with 202 Accepted
  • If expectReply=true and no reply received within timeout, throws MessageTimeoutException
  • Path variables accessible via #pathVariables in SpEL expressions
  • Query parameters accessible via #requestParams in SpEL expressions
  • Request body accessible via body in SpEL expressions
  • Headers accessible via headers in SpEL expressions

Capabilities

HttpRequestHandlingMessagingGateway

The primary gateway for handling HTTP requests as Spring Integration messages. Can be used with HttpRequestHandlerServlet or Spring MVC's DispatcherServlet. Supports both one-way (fire-and-forget) and request-reply patterns.

public class HttpRequestHandlingMessagingGateway
    extends HttpRequestHandlingEndpointSupport
    implements HttpRequestHandler {

    /**
     * Creates a gateway that expects a reply.
     */
    public HttpRequestHandlingMessagingGateway();

    /**
     * Creates a gateway with specified reply expectation.
     *
     * @param expectReply whether to expect a reply message
     */
    public HttpRequestHandlingMessagingGateway(boolean expectReply);

    /**
     * Sets whether exceptions should be converted to HTTP responses.
     * When true, exceptions are written to the response with appropriate
     * status codes instead of being propagated.
     *
     * @param convertExceptions true to convert exceptions (default: false)
     */
    public void setConvertExceptions(boolean convertExceptions);

    /**
     * Handles incoming HTTP request and generates response.
     *
     * @param servletRequest the HTTP servlet request
     * @param servletResponse the HTTP servlet response
     * @throws ServletException if servlet error occurs
     * @throws IOException if I/O error occurs
     */
    public void handleRequest(
        HttpServletRequest servletRequest,
        HttpServletResponse servletResponse)
        throws ServletException, IOException;
}

Usage Example:

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway;
import org.springframework.integration.http.inbound.RequestMapping;
import org.springframework.integration.channel.DirectChannel;
import org.springframework.http.HttpMethod;

@Configuration
public class InboundGatewayConfig {

    @Bean
    public DirectChannel httpRequestChannel() {
        return new DirectChannel();
    }

    @Bean
    public DirectChannel httpReplyChannel() {
        return new DirectChannel();
    }

    @Bean
    public HttpRequestHandlingMessagingGateway orderGateway() {
        HttpRequestHandlingMessagingGateway gateway =
            new HttpRequestHandlingMessagingGateway(true); // expects reply

        // Set request and reply channels
        gateway.setRequestChannel(httpRequestChannel());
        gateway.setReplyChannel(httpReplyChannel());

        // Configure URL mapping
        RequestMapping mapping = new RequestMapping();
        mapping.setPathPatterns("/api/orders");
        mapping.setMethods(HttpMethod.POST);
        mapping.setConsumes("application/json");
        mapping.setProduces("application/json");
        gateway.setRequestMapping(mapping);

        // Set payload type for automatic conversion
        gateway.setRequestPayloadTypeClass(Order.class);

        // Enable exception conversion
        gateway.setConvertExceptions(true);

        return gateway;
    }
}

HttpRequestHandlingController

Spring MVC Controller-based HTTP endpoint that returns ModelAndView for rendering views. Suitable for form-based applications and scenarios where server-side rendering is needed.

public class HttpRequestHandlingController
    extends HttpRequestHandlingEndpointSupport
    implements Controller {

    public static final String DEFAULT_ERROR_CODE = "spring.integration.http.handler.error";
    public static final String DEFAULT_REPLY_KEY = "reply";
    public static final String DEFAULT_ERRORS_KEY = "errors";

    /**
     * Creates a controller that expects a reply.
     */
    public HttpRequestHandlingController();

    /**
     * Creates a controller with specified reply expectation.
     *
     * @param expectReply whether to expect a reply message
     */
    public HttpRequestHandlingController(boolean expectReply);

    /**
     * Sets the MVC view name to render.
     *
     * @param viewName the view name
     */
    public void setViewName(String viewName);

    /**
     * Sets a SpEL expression to evaluate the view name dynamically.
     *
     * @param viewExpression the view name expression
     */
    public void setViewExpression(Expression viewExpression);

    /**
     * Sets the key for the reply Message or payload in the model map.
     *
     * @param replyKey the model key (default: "reply")
     */
    public void setReplyKey(String replyKey);

    /**
     * Sets the key for binding errors in the model map.
     *
     * @param errorsKey the errors key (default: "errors")
     */
    public void setErrorsKey(String errorsKey);

    /**
     * Sets the error code for message handling errors.
     *
     * @param errorCode the error code
     */
    public void setErrorCode(String errorCode);

    /**
     * Handles HTTP request and returns ModelAndView.
     *
     * @param servletRequest the HTTP servlet request
     * @param servletResponse the HTTP servlet response
     * @return the ModelAndView for rendering
     * @throws Exception if error occurs
     */
    public ModelAndView handleRequest(
        HttpServletRequest servletRequest,
        HttpServletResponse servletResponse)
        throws Exception;
}

Usage Example:

@Bean
public HttpRequestHandlingController formController() {
    HttpRequestHandlingController controller =
        new HttpRequestHandlingController(true);

    // Set request channel
    controller.setRequestChannel(formProcessingChannel());

    // Configure URL mapping
    RequestMapping mapping = new RequestMapping();
    mapping.setPathPatterns("/forms/submit");
    mapping.setMethods(HttpMethod.POST);
    controller.setRequestMapping(mapping);

    // Set view configuration
    controller.setViewName("formResult");
    controller.setReplyKey("result");
    controller.setErrorsKey("validationErrors");

    // Add validator
    controller.setValidator(new FormValidator());

    return controller;
}

BaseHttpInboundEndpoint

Base class for HTTP inbound endpoints providing common configuration options. This class is extended by HttpRequestHandlingMessagingGateway and HttpRequestHandlingController.

public class BaseHttpInboundEndpoint
    extends MessagingGatewaySupport
    implements OrderlyShutdownCapable {

    public static final List<HttpMethod> NON_READABLE_BODY_HTTP_METHODS;
    public static final boolean JAXB_PRESENT;
    public static final boolean ROME_TOOLS_PRESENT;

    /**
     * Creates endpoint with specified reply expectation.
     *
     * @param expectReply whether to expect a reply message
     */
    protected BaseHttpInboundEndpoint(boolean expectReply);

    /**
     * Sets SpEL expression to evaluate for the Message payload.
     * Allows custom payload extraction from HttpEntity.
     *
     * @param payloadExpression the payload expression
     */
    public void setPayloadExpression(Expression payloadExpression);

    /**
     * Sets Map of SpEL expressions for Message headers.
     * Expressions are evaluated against HttpEntity.
     *
     * @param headerExpressions the header expressions
     */
    public void setHeaderExpressions(Map<String, Expression> headerExpressions);

    /**
     * Sets RequestMapping for flexible RESTful mapping.
     *
     * @param requestMapping the request mapping configuration
     */
    public void setRequestMapping(RequestMapping requestMapping);

    /**
     * Returns the RequestMapping configuration.
     *
     * @return the request mapping
     */
    public RequestMapping getRequestMapping();

    /**
     * Sets CrossOrigin configuration for CORS support.
     *
     * @param crossOrigin the CORS configuration
     */
    public void setCrossOrigin(CrossOrigin crossOrigin);

    /**
     * Returns the CrossOrigin configuration.
     *
     * @return the CORS configuration
     */
    public CrossOrigin getCrossOrigin();

    /**
     * Sets HeaderMapper for mapping between HTTP and Message headers.
     *
     * @param headerMapper the header mapper
     */
    public void setHeaderMapper(HeaderMapper<HttpHeaders> headerMapper);

    /**
     * Sets payload type class for inbound request conversion.
     *
     * @param requestPayloadType the payload type class
     */
    public void setRequestPayloadTypeClass(Class<?> requestPayloadType);

    /**
     * Sets ResolvableType for inbound request payload with generics support.
     *
     * @param requestPayloadType the resolvable type
     */
    public void setRequestPayloadType(ResolvableType requestPayloadType);

    /**
     * Controls whether only reply payload should be passed in HTTP response.
     * When false, entire Message including headers is used.
     *
     * @param extractReplyPayload true to extract only payload (default: true)
     */
    public void setExtractReplyPayload(boolean extractReplyPayload);

    /**
     * Sets status code expression as String (SpEL).
     *
     * @param statusCodeExpression the status code expression
     */
    public void setStatusCodeExpressionString(String statusCodeExpression);

    /**
     * Sets Expression to resolve HTTP status code dynamically.
     * Expression is evaluated against RequestEntity.
     *
     * @param statusCodeExpression the status code expression
     */
    public void setStatusCodeExpression(Expression statusCodeExpression);

    /**
     * Sets Validator for payload validation before processing.
     *
     * @param validator the validator
     */
    public void setValidator(Validator validator);

    /**
     * Returns active request count before shutdown.
     *
     * @return the active count
     */
    public int beforeShutdown();

    /**
     * Returns active request count after shutdown.
     *
     * @return the active count
     */
    public int afterShutdown();

    public String getComponentType();
    public IntegrationPatternType getIntegrationPatternType();
}

HttpRequestHandlingEndpointSupport

Base class for HTTP request handling endpoints with message converter support. Provides multipart resolution and message conversion capabilities.

public abstract class HttpRequestHandlingEndpointSupport
    extends BaseHttpInboundEndpoint {

    /**
     * Creates endpoint that expects a reply.
     */
    protected HttpRequestHandlingEndpointSupport();

    /**
     * Creates endpoint with specified reply expectation.
     *
     * @param expectReply whether to expect a reply message
     */
    protected HttpRequestHandlingEndpointSupport(boolean expectReply);

    /**
     * Sets message body converters for request/response conversion.
     * Replaces default converters unless mergeWithDefaultConverters is true.
     *
     * @param messageConverters the list of message converters
     */
    public void setMessageConverters(
        List<HttpMessageConverter<?>> messageConverters);

    /**
     * Controls whether custom converters should be merged with default converters.
     * When true, custom converters are tried first, then defaults.
     *
     * @param mergeWithDefaultConverters true to merge (default: false)
     */
    public void setMergeWithDefaultConverters(
        boolean mergeWithDefaultConverters);

    /**
     * Sets MultipartResolver for handling multipart file uploads.
     *
     * @param multipartResolver the multipart resolver
     */
    public void setMultipartResolver(MultipartResolver multipartResolver);
}

RequestMapping

Configuration class for mapping web requests to HTTP inbound endpoints. Similar to Spring MVC's @RequestMapping annotation but configured programmatically.

public class RequestMapping {

    /**
     * Returns the mapping name.
     *
     * @return the name
     */
    public String getName();

    /**
     * Sets the mapping name for identification.
     *
     * @param name the mapping name
     */
    public void setName(String name);

    /**
     * Sets path patterns for URL mapping.
     * Supports path variables like "/api/orders/{id}".
     *
     * @param pathPatterns the path patterns
     */
    public void setPathPatterns(String... pathPatterns);

    /**
     * Returns the path patterns.
     *
     * @return the path patterns
     */
    public String[] getPathPatterns();

    /**
     * Sets supported HTTP methods from String names.
     *
     * @param supportedMethods method names like "GET", "POST"
     */
    public void setMethodNames(String... supportedMethods);

    /**
     * Sets supported HTTP methods.
     * Default: GET, POST.
     *
     * @param supportedMethods the HTTP methods
     */
    public void setMethods(HttpMethod... supportedMethods);

    /**
     * Returns the supported HTTP methods.
     *
     * @return the HTTP methods
     */
    public HttpMethod[] getMethods();

    /**
     * Sets request parameters that must be present.
     * Format: "param=value" or "param" (any value).
     *
     * @param params the request parameters
     */
    public void setParams(String... params);

    /**
     * Returns the request parameters.
     *
     * @return the parameters
     */
    public String[] getParams();

    /**
     * Sets request headers that must be present.
     * Format: "header=value" or "header" (any value).
     *
     * @param headers the request headers
     */
    public void setHeaders(String... headers);

    /**
     * Returns the request headers.
     *
     * @return the headers
     */
    public String[] getHeaders();

    /**
     * Sets consumable media types (Content-Type).
     * Example: "application/json", "text/xml".
     *
     * @param consumes the consumable media types
     */
    public void setConsumes(String... consumes);

    /**
     * Returns the consumable media types.
     *
     * @return the consumes media types
     */
    public String[] getConsumes();

    /**
     * Sets producible media types (Accept).
     * Example: "application/json", "text/xml".
     *
     * @param produces the producible media types
     */
    public void setProduces(String... produces);

    /**
     * Returns the producible media types.
     *
     * @return the produces media types
     */
    public String[] getProduces();

    /**
     * Returns Spring RequestMethod array for Spring MVC integration.
     *
     * @return the request methods
     */
    public RequestMethod[] getRequestMethods();
}

Usage Example:

RequestMapping mapping = new RequestMapping();
mapping.setName("orderEndpoint");
mapping.setPathPatterns("/api/orders/{id}", "/api/orders");
mapping.setMethods(HttpMethod.GET, HttpMethod.POST);
mapping.setParams("version=2");
mapping.setHeaders("X-API-Key");
mapping.setConsumes("application/json", "application/xml");
mapping.setProduces("application/json");

CrossOrigin

Configuration class for CORS (Cross-Origin Resource Sharing) mapping for HTTP inbound endpoints. Enables browser-based clients from different origins to access endpoints.

public class CrossOrigin {

    /**
     * Sets allowed origins for cross-origin requests.
     * Use "*" to allow all origins (not recommended for production).
     *
     * @param origin the allowed origins (e.g., "https://example.com")
     */
    public void setOrigin(String... origin);

    /**
     * Returns the allowed origins.
     *
     * @return the origins
     */
    public String[] getOrigin();

    /**
     * Sets allowed request headers for preflight requests.
     *
     * @param allowedHeaders the allowed headers
     */
    public void setAllowedHeaders(String... allowedHeaders);

    /**
     * Returns the allowed headers.
     *
     * @return the allowed headers
     */
    public String[] getAllowedHeaders();

    /**
     * Sets headers that can be exposed to the client.
     *
     * @param exposedHeaders the exposed headers
     */
    public void setExposedHeaders(String... exposedHeaders);

    /**
     * Returns the exposed headers.
     *
     * @return the exposed headers
     */
    public String[] getExposedHeaders();

    /**
     * Sets supported HTTP methods for CORS.
     *
     * @param method the request methods
     */
    public void setMethod(RequestMethod... method);

    /**
     * Returns the supported HTTP methods.
     *
     * @return the methods
     */
    public RequestMethod[] getMethod();

    /**
     * Sets whether to allow credentials (cookies, authorization headers).
     *
     * @param allowCredentials true to allow credentials
     */
    public void setAllowCredentials(Boolean allowCredentials);

    /**
     * Returns whether credentials are allowed.
     *
     * @return the allowCredentials flag
     */
    public Boolean getAllowCredentials();

    /**
     * Sets max age in seconds for preflight request caching.
     * Default: 1800 (30 minutes).
     *
     * @param maxAge the max age in seconds
     */
    public void setMaxAge(long maxAge);

    /**
     * Returns the max age.
     *
     * @return the max age in seconds
     */
    public long getMaxAge();
}

Usage Example:

CrossOrigin cors = new CrossOrigin();
cors.setOrigin("https://app.example.com", "https://admin.example.com");
cors.setAllowedHeaders("Authorization", "Content-Type", "X-Custom-Header");
cors.setExposedHeaders("X-Total-Count", "X-Page-Number");
cors.setMethod(RequestMethod.GET, RequestMethod.POST, RequestMethod.PUT);
cors.setAllowCredentials(true);
cors.setMaxAge(3600); // 1 hour

gateway.setCrossOrigin(cors);

IntegrationRequestMappingHandlerMapping

HandlerMapping implementation that detects and registers RequestMappingInfos for HTTP inbound endpoints. Automatically integrates with Spring MVC's DispatcherServlet.

public final class IntegrationRequestMappingHandlerMapping
    extends RequestMappingHandlerMapping
    implements ApplicationListener<ContextRefreshedEvent> {

    /**
     * Handles ContextRefreshedEvent to initialize handler mappings.
     * Called automatically by Spring when context is refreshed.
     *
     * @param event the context refreshed event
     */
    public void onApplicationEvent(ContextRefreshedEvent event);

    /**
     * No-op in favor of onApplicationEvent.
     * Overrides superclass initialization.
     */
    @Override
    public void afterPropertiesSet();
}

This bean is automatically registered when HTTP integration is configured and handles the registration of all HTTP inbound endpoints with Spring MVC.

DynamicRequestMappingBeanPostProcessor

BeanPostProcessor that registers and unregisters request mappings for dynamically created HTTP inbound endpoints at runtime.

public class DynamicRequestMappingBeanPostProcessor
    implements BeanFactoryAware,
               DestructionAwareBeanPostProcessor,
               SmartInitializingSingleton {

    /**
     * Sets the BeanFactory.
     *
     * @param beanFactory the bean factory
     */
    public void setBeanFactory(BeanFactory beanFactory)
        throws BeansException;

    /**
     * Called after all singletons are instantiated.
     */
    public void afterSingletonsInstantiated();

    /**
     * Registers request mapping before bean initialization.
     *
     * @param bean the bean
     * @param beanName the bean name
     * @return the bean
     * @throws BeansException if error occurs
     */
    public Object postProcessBeforeInitialization(
        Object bean, String beanName) throws BeansException;

    /**
     * Unregisters request mapping before bean destruction.
     *
     * @param bean the bean
     * @param beanName the bean name
     * @throws BeansException if error occurs
     */
    public void postProcessBeforeDestruction(
        Object bean, String beanName) throws BeansException;

    /**
     * Checks if bean requires destruction callback.
     *
     * @param bean the bean
     * @return true if destruction is needed
     */
    public boolean requiresDestruction(Object bean);
}

This processor is automatically registered and enables dynamic registration/unregistration of HTTP endpoints at runtime.

Advanced Usage Patterns

Dynamic Payload Extraction

Use SpEL expressions to extract custom payloads from HTTP requests:

@Bean
public HttpRequestHandlingMessagingGateway customPayloadGateway() {
    HttpRequestHandlingMessagingGateway gateway =
        new HttpRequestHandlingMessagingGateway();

    gateway.setRequestChannel(requestChannel());

    // Extract specific data from request
    SpelExpressionParser parser = new SpelExpressionParser();
    gateway.setPayloadExpression(
        parser.parseExpression("body.data.customField"));

    RequestMapping mapping = new RequestMapping();
    mapping.setPathPatterns("/api/custom");
    gateway.setRequestMapping(mapping);

    return gateway;
}

Custom Header Extraction

Extract and map custom headers to message headers:

@Bean
public HttpRequestHandlingMessagingGateway headerMappingGateway() {
    HttpRequestHandlingMessagingGateway gateway =
        new HttpRequestHandlingMessagingGateway();

    gateway.setRequestChannel(requestChannel());

    // Map custom headers
    SpelExpressionParser parser = new SpelExpressionParser();
    Map<String, Expression> headerExpressions = new HashMap<>();
    headerExpressions.put("userId",
        parser.parseExpression("headers['X-User-ID']"));
    headerExpressions.put("requestId",
        parser.parseExpression("headers['X-Request-ID']"));
    gateway.setHeaderExpressions(headerExpressions);

    RequestMapping mapping = new RequestMapping();
    mapping.setPathPatterns("/api/data");
    gateway.setRequestMapping(mapping);

    return gateway;
}

Path Variable Extraction

Extract path variables from URLs using payload expressions:

@Bean
public HttpRequestHandlingMessagingGateway pathVariableGateway() {
    HttpRequestHandlingMessagingGateway gateway =
        new HttpRequestHandlingMessagingGateway();

    gateway.setRequestChannel(requestChannel());

    // Extract path variable as payload
    SpelExpressionParser parser = new SpelExpressionParser();
    gateway.setPayloadExpression(
        parser.parseExpression("#pathVariables.customerId"));

    RequestMapping mapping = new RequestMapping();
    mapping.setPathPatterns("/api/customers/{customerId}/orders");
    gateway.setRequestMapping(mapping);

    return gateway;
}

Validation Integration

Integrate Spring Validator for payload validation:

import org.springframework.validation.Validator;
import org.springframework.validation.Errors;

@Bean
public HttpRequestHandlingMessagingGateway validatingGateway() {
    HttpRequestHandlingMessagingGateway gateway =
        new HttpRequestHandlingMessagingGateway();

    gateway.setRequestChannel(requestChannel());
    gateway.setRequestPayloadTypeClass(OrderRequest.class);

    // Add validator
    gateway.setValidator(new Validator() {
        @Override
        public boolean supports(Class<?> clazz) {
            return OrderRequest.class.isAssignableFrom(clazz);
        }

        @Override
        public void validate(Object target, Errors errors) {
            OrderRequest order = (OrderRequest) target;
            if (order.getAmount() <= 0) {
                errors.rejectValue("amount", "amount.invalid",
                    "Amount must be positive");
            }
        }
    });

    RequestMapping mapping = new RequestMapping();
    mapping.setPathPatterns("/api/orders");
    gateway.setRequestMapping(mapping);

    return gateway;
}

When validation fails, an IntegrationWebExchangeBindException is thrown containing validation errors.

Dynamic Status Code Resolution

Resolve HTTP status codes dynamically based on message processing:

@Bean
public HttpRequestHandlingMessagingGateway statusCodeGateway() {
    HttpRequestHandlingMessagingGateway gateway =
        new HttpRequestHandlingMessagingGateway();

    gateway.setRequestChannel(requestChannel());

    // Set dynamic status code
    SpelExpressionParser parser = new SpelExpressionParser();
    gateway.setStatusCodeExpression(
        parser.parseExpression(
            "body.newResource ? T(org.springframework.http.HttpStatus).CREATED " +
            ": T(org.springframework.http.HttpStatus).OK"));

    RequestMapping mapping = new RequestMapping();
    mapping.setPathPatterns("/api/resources");
    gateway.setRequestMapping(mapping);

    return gateway;
}

Integration with Spring MVC

HTTP inbound endpoints integrate seamlessly with Spring MVC:

@Configuration
@EnableWebMvc
public class WebMvcConfig implements WebMvcConfigurer {

    @Bean
    public IntegrationRequestMappingHandlerMapping integrationHandlerMapping() {
        IntegrationRequestMappingHandlerMapping mapping =
            new IntegrationRequestMappingHandlerMapping();
        mapping.setOrder(0); // Process before other mappings
        return mapping;
    }

    @Bean
    public HttpRequestHandlingMessagingGateway integrationEndpoint() {
        HttpRequestHandlingMessagingGateway gateway =
            new HttpRequestHandlingMessagingGateway();

        RequestMapping mapping = new RequestMapping();
        mapping.setPathPatterns("/integration/**");
        gateway.setRequestMapping(mapping);
        gateway.setRequestChannel(integrationChannel());

        return gateway;
    }
}

The IntegrationRequestMappingHandlerMapping is automatically detected by Spring MVC and integrates HTTP inbound endpoints with the standard handler mapping chain.