Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-1677

Ability to access parameters from HTTP GET inbound requests when constructing outbound calls

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 2.0 Final
    • Fix Version/s: 2.1 M1
    • Component/s: Web Services
    • Labels:
      None

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                oleg.zhurakousky@springsource.com Oleg Zhurakousky
                Reporter:
                neilac333 Neil Chaudhuri
              • Votes:
                2 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: