Spring Integration
  1. Spring Integration
  2. INT-2570

Add support for URL Expression for Http Outbound adapter/gateway

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: 2.2 M1
    • Fix Version/s: 2.2 M2
    • Component/s: None
    • Labels:
      None

      Description

      Based on the changes that are described in INT-2569 (which is actually a mitigation to avoid breaking change and not really a recommended way of doing things) we need to provide this attribute to formally support ability to provide URL dynamically
      For example:
      Instead of

      <int-http:outbound-gateway url="{url}" request-channel="vmwChannel" reply-channel="replyChannel"
      					expected-response-type="java.lang.String" http-method="GET">
      	<int-http:uri-variable name="url" expression="payload" encode="false"/>
      </int-http:outbound-gateway>
      

      we'f have something like

      <int-http:outbound-gateway url-expression="payload" request-channel="vmwChannel" reply-channel="replyChannel"
      					expected-response-type="java.lang.String" http-method="GET"/>
      

        Issue Links

          Activity

          Show
          Gary Russell added a comment - PR Issued: https://github.com/SpringSource/spring-integration/pull/458
          Hide
          Gary Russell added a comment -

          Missed some DFA tests

          Show
          Gary Russell added a comment - Missed some DFA tests
          Hide
          dheerja arora added a comment -

          I implemented url expression but getting

          Show
          dheerja arora added a comment - I implemented url expression but getting
          Hide
          dheerja arora added a comment -

          preSend on channel 'requestChannel1', message: [Payload=http://api.pdn.coupons.com/cpr/shopping/16681/users/100829679/lists/19a3862b-779a-4a65-ba5a-2968205345ca?gwauth_token=8038e590-58b9-4deb-86fa-9638c3b94e6e&ts=1354788235&sig=1d5bca4e615ed4481922161c66571d232525de03]
          Caused by: java.lang.IllegalStateException: Could not create URI object: Illegal character in scheme name at index 0: %22http://api.pdn.coupons.com/cpr/shopping/16681/users/100829679/lists/19a3862b-779a-4a65-ba5a-2968205345ca?gwauth_token=8038e590-58b9-4deb-86fa-9638c3b94e6e&ts=1354788235&sig=1d5bca4e615ed4481922161c66571d232525de03%22
          at org.springframework.web.util.UriComponents.toUri(UriComponents.java:533)
          at org.springframework.web.util.UriTemplate.expand(UriTemplate.java:103)
          at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:408)
          at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:384)
          at org.springframework.integration.http.outbound.HttpRequestExecutingMessageHandler.handleRequestMessage(HttpRequestExecutingMessageHandler.java:351)
          ... 34 more

          Show
          dheerja arora added a comment - preSend on channel 'requestChannel1', message: [Payload=http://api.pdn.coupons.com/cpr/shopping/16681/users/100829679/lists/19a3862b-779a-4a65-ba5a-2968205345ca?gwauth_token=8038e590-58b9-4deb-86fa-9638c3b94e6e&ts=1354788235&sig=1d5bca4e615ed4481922161c66571d232525de03] Caused by: java.lang.IllegalStateException: Could not create URI object: Illegal character in scheme name at index 0: %22http://api.pdn.coupons.com/cpr/shopping/16681/users/100829679/lists/19a3862b-779a-4a65-ba5a-2968205345ca?gwauth_token=8038e590-58b9-4deb-86fa-9638c3b94e6e&ts=1354788235&sig=1d5bca4e615ed4481922161c66571d232525de03%22 at org.springframework.web.util.UriComponents.toUri(UriComponents.java:533) at org.springframework.web.util.UriTemplate.expand(UriTemplate.java:103) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:408) at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:384) at org.springframework.integration.http.outbound.HttpRequestExecutingMessageHandler.handleRequestMessage(HttpRequestExecutingMessageHandler.java:351) ... 34 more
          Hide
          Mark Fisher added a comment -

          Please do not double post in JIRA. The same information was reported as a bug (even though it appears to be a mis-configuration) here: INT-2850

          Show
          Mark Fisher added a comment - Please do not double post in JIRA. The same information was reported as a bug (even though it appears to be a mis-configuration) here: INT-2850
          Hide
          dheerja arora added a comment -

          The above example explains the scenario in case of Get call.
          How do we handle when we have a Post call with a request body and a dynamic url
          If i try putting both(string url , object ) in the payload it gives me an error - Cannot add 2 objects in payload.
          Please suggest how do I handle Post calls

          Show
          dheerja arora added a comment - The above example explains the scenario in case of Get call. How do we handle when we have a Post call with a request body and a dynamic url If i try putting both(string url , object ) in the payload it gives me an error - Cannot add 2 objects in payload. Please suggest how do I handle Post calls
          Hide
          Mark Fisher added a comment -

          Please post usage questions on the forum and not in JIRA:
          http://forum.springsource.org/forumdisplay.php?42-Integration

          Even if you think there might be a bug, it's best to post in the forum first. Someone responding there would be able to let you know whether to escalate it to JIRA. In this case though, you are asking a question that can be addressed by reading the manual or posting to the forum.

          Show
          Mark Fisher added a comment - Please post usage questions on the forum and not in JIRA: http://forum.springsource.org/forumdisplay.php?42-Integration Even if you think there might be a bug, it's best to post in the forum first. Someone responding there would be able to let you know whether to escalate it to JIRA. In this case though, you are asking a question that can be addressed by reading the manual or posting to the forum.

            People

            • Assignee:
              Gary Russell
              Reporter:
              Oleg Zhurakousky
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: