Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8808755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:42:03+00:00 2026-06-14T02:42:03+00:00

In order to send http request to dynamic urls based on message headers… I

  • 0

In order to send http request to dynamic urls based on message headers…

I am trying to set the url value from Message header as follows:

 <int-http:outbound-gateway id="httpOutboundGateway" request-channel="fromMyQueue" 
    url="{outboundGatewayUrl}" reply-channel="nullChannel" 
    http-method="POST" expected-response-type="java.lang.String" charset="UTF-8">
<int-http:uri-variable name="outboundGatewayUrl" expression="headers['X-CUSTOM-HTTP-REQUEST-URL']" />

But this is not working.
Apparently {outboundGatewayUrl} value is not being replaced at all.
This works if i replace the {outboundGatewayUrl} with actual URL.

Error Message:

Caused by:
org.springframework.integration.MessageHandlingException: HTTP request execution failed for URI [{outboundGatewayUrl}]...

Caused by:<br> java.lang.IllegalArgumentException: URI is not absolute
    at java.net.URI.toURL(URI.java:1080)
    at org.springframework.http.client.SimpleClientHttpRequestFactory.createRequest(SimpleClientHttpRequestFactory.java:109)

What am i missing here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:42:04+00:00Added an answer on June 14, 2026 at 2:42 am

    It looks like header X-CUSTOM-HTTP-REQUEST-URL doesn’t exist in the message.

    You will get that error (URI is not absolute) if the expression returns null (i.e. if the header doesn’t exist).

    I just ran a test and it worked fine for me with a proper header; if you believe the header is correct, you should break down the problem; for example by using a literal expression first…

    <int-http:uri-variable name="outboundGatewayUrl" expression="'http://foo/bar'" />
    

    The error message is, perhaps somewhat misleading:

    Caused by:
    org.springframework.integration.MessageHandlingException: HTTP request execution failed    for URI [{outboundGatewayUrl}]...
    

    because it implies the url wasn’t expanded. The problem is the expansion is done inside the RestTemplate and the adapter doesn’t have access to it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there headers you can send with a HTTP request that tell the web
I'm trying to send a POST request containing multiple binary files to a HTTP
In order to send and receive encrypted messages from/to the iPhone I need to
Trying to honor a feature request from our customers, I'd like that my application,
I'm writing an aspx page which has to send an http request to a
I'm trying to send an XMLHttpRequest object to my Rails server but the headers
In order to test my program, I want to send about 50 http requests
I'm making a Java console application that needs to send an HTTP request to
I want to send to test.com a request from 0 to 100, the code
I am using Pcapdot.net DLLs in order to send buffer of packets to my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.