camel-quarkus-http not respecting CamelHttpPath Header when using "toD"

Solution Verified - Updated -

Issue

  • PATH is missing in the CamelHttpPath header.

    • Trying to migrate from 2.7.6.Final-redhat-00006 to 2.13.5.SP1-redhat-00002 and noticed a unit test failed.
    • Wiremock wasn't able to match the URL was calling, which was just a hostname with my path missing.
    • Calling echo-api.3scale.net just to see what I am sending for my HTTP request. with 2.7.6.Final-redhat-00006:
    2023-02-03 23:50:42,302 INFO  [route2] (Camel (camel-1) thread #1 - timer://goTime) {
    "method": "GET",
    "path": "/what-a-path",
    "args": "",
    "body": "",
    "headers": {
    "HTTP_VERSION": "HTTP/1.1",
    "HTTP_HOST": "echo-api.3scale.net",
    "HTTP_FIREDTIME": "Fri Feb 03 23:50:41 EST 2023",
    "HTTP_USER_AGENT": "Apache-HttpClient/4.5.13.redhat-00002 (Java/11.0.15)",
    "HTTP_ACCEPT_ENCODING": "gzip,deflate",
    "HTTP_X_FORWARDED_FOR": "192.197.178.2",
    "HTTP_X_FORWARDED_PROTO": "https",
    "HTTP_X_ENVOY_EXTERNAL_ADDRESS": "192.197.178.2",
    "HTTP_X_REQUEST_ID": "c6a628dc-a55b-435b-a0e6-8bdf6546172f",
    "HTTP_X_ENVOY_EXPECTED_RQ_TIMEOUT_MS": "15000"
    },
    "uuid": "eeb65948-ce05-4004-9a58-3bcff1bbfa17"
    }
    
    • But with 2.13.5.SP1-redhat-00002 you can see the path is missing:
    2023-02-03 23:52:49,282 INFO  [route2] (Camel (camel-1) thread #1 - timer://goTime) {
    "method": "GET",
    "path": "/",
    "args": "",
    "body": "",
    "headers": {
    "HTTP_VERSION": "HTTP/1.1",
    "HTTP_HOST": "echo-api.3scale.net",
    "HTTP_FIREDTIME": "Fri Feb 03 23:52:48 EST 2023",
    "HTTP_USER_AGENT": "Apache-HttpClient/4.5.13.redhat-00002 (Java/11.0.15)",
    "HTTP_ACCEPT_ENCODING": "gzip,deflate",
    "HTTP_X_FORWARDED_FOR": "192.197.178.2",
    "HTTP_X_FORWARDED_PROTO": "https",
    "HTTP_X_ENVOY_EXTERNAL_ADDRESS": "192.197.178.2",
    "HTTP_X_REQUEST_ID": "3a7769bc-c86d-4ad1-b36d-1f817b379c58",
    "HTTP_X_ENVOY_EXPECTED_RQ_TIMEOUT_MS": "15000"
    },
    "uuid": "61b48f21-0c7d-4e9e-b53a-86e73d73713a"
    }
    
  • org.apache.camel.http.common.HttpHelper.createURL(Exchange exchange, HttpCommonEndpoint endpoint), the part where you retrieve the path also gives empty string:

    String path = exchange.getIn().getHeader(Exchange.HTTP_PATH, String.class);
    

Environment

  • Red Hat Integration-Camel Extensions for Quarkus
    • 2.13.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content