Announcement Announcement Module
Collapse
No announcement yet.
Replacing HTTP URL in outbound-gateway Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Replacing HTTP URL in outbound-gateway

    The following outbound gateway is retrieving and replacing the complete url. Before calling the gateway, the url is constructed by a transformer and stored into in header(X_REQUEST_URL) using enricher.

    <http:outbound-gateway id="OutBoundGateway"
    request-channel="outbound-request-channel"
    reply-channel="outbound-response-channel"
    url = "{outBoundGatewayUrl}"
    http-method="GET"
    expected-response-type="java.lang.String"
    reply-timeout="5000"
    charset="UTF-8">
    <http:uri-variable name="outBoundGatewayUrl" expression="headers['X_REQUEST_URL']" />
    </http:outbound-gateway>

    The issue is only '?' in url is encoding to %3F , whereas rest of the url is intact. The output string (url) of transformer is clear text only: "http://localhost:8080/path?api=login&account_login=1234", so, surprised where is '?' being encoded?

    Please suggest.

  • #2
    This is strange, but certainly looks like a bug. Could you please raise a JIRA issue https://jira.springsource.org/browse/INT and we'll see what we can do.

    Comment


    • #3
      Hello

      Which versions of Spring Web & Spring Integration do you use?

      I can't reproduce it on Spring Web 3.0.7 & Spring Integration 2.1.1.

      I've put into header "http://host/test?foo=foo &bar=bar"
      and gotten "http://host/test?foo=foo%20&bar=bar"

      Artem Bilan

      Comment


      • #4
        There is some interesting and relevant info (in terms of the role of ? in the end-result URI) here: https://jira.springsource.org/browse/SPR-8403

        ...and there are a few other issues in core Spring related to UriTemplate behavior. I believe some of those changes were also backported to 3.0.6 or 3.0.7, so I'm also interested to hear what version you are using and if upgrading addresses the problem.

        Comment


        • #5
          I am using spring-web-3.1.0 & SI-2.1.0.

          thanks,
          Janit

          Comment


          • #6
            Seems like issue is due to underlying UriTemplate.

            Janit Sharma

            Comment

            Working...
            X