Skip to content

Ability to access parameters from HTTP GET inbound requests when constructing outbound calls [INT-1677] #5673

@spring-operator

Description

@spring-operator

Neil Chaudhuri opened INT-1677 and commented

REST HTTP GET requests contain parameters in the path and in the query string. Currently, Spring Integration captures path parameters like id in the following example

<http:inbound-gateway     id="documentByIdInboundGateway"
                          request-channel="documentByIdRequestChannel"
                          reply-channel="documentByIdReplyChannel"
                          name="/documents/{id}"
                          supported-methods="GET"/>

DEBUG [BeanNameUrlHandlerMapping.lookupHandler] Matching patterns for request [/documents/1232332] are [/documents/{id}]
DEBUG [BeanNameUrlHandlerMapping.lookupHandler] URI Template variables for request [/documents/1232332] are {id=1232332}

However, it is impossible to access these URI template variables in order to construct an outbound call from them. The is a feature request for an API to retrieve the id from above for the following outbound call for example:

<http:outbound-gateway     id="documentByIdTargetAdapter"
                           url="http://localhost:8080/myapp/documents/{id}"
                           http-method="GET"
                           request-channel="documentByIdRequestChannel"
                           reply-channel="targetDocumentByIdReplyChannel"
                           expected-response-type="com.myapp.Document"
                           charset="UTF-8"
                           header-mapper="jsonHeaderMapper">

Of course, the outbound request could be of any kind and not just a REST call.

Incidentally, it is unclear what the current Spring Integration behavior is for query parameters. Regardless, this feature request applies to all inbound REST parameters.


Affects: 2.0 Final

Reference URL: http://forum.springsource.org/showthread.php?t=99493

Issue Links:

2 votes, 1 watchers

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions