[
https://issues.apache.org/jira/browse/CAMEL-24629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18113388#comment-18113388
]
Cameron Fitzwater commented on CAMEL-24629:
-------------------------------------------
Yes, this is indeed the same steps and behavior seen by me.
My comment about the difference between using {{-to:}} vs {{-toD:}} was with
regards to the fact that:
# with camel run, the app starts but errors and exists right away (likely
becasue toD is attempting to resolve upfront, whereas to: will only resolve one
hit/accessed).
# related to #1, export actually fails due to this when toD code existed.
All that aside, I agree with findings, and that Camel is working as intended,
and that the env:HOST notation can be used across all runtimes (which is what I
ended up doing to move forward).
I do wonder if this can/should be converted over into a feature request then,
to allow application.properties to resolve .env variables with that ${HOST}
syntax vs being static – what are the thoughts on that?
> toD not taking into account substituted properties with env variables
> ---------------------------------------------------------------------
>
> Key: CAMEL-24629
> URL: https://issues.apache.org/jira/browse/CAMEL-24629
> Project: Camel
> Issue Type: Bug
> Components: camel-core
> Affects Versions: 4.22.0
> Reporter: Cameron Fitzwater
> Assignee: Torsten Mielke
> Priority: Minor
> Attachments: camel-24629.zip
>
>
> I have a .env file that has:
> MY_HOST=abc
>
> My application.properties file has:
> my.host=${MY_HOST}
>
> When using {*}toD{*}:
> - toD:
> uri:
> "https://{{{{{}my.host{}}}}}.domain.com/${exchangeProperty.location}"
> parameters:
> lean: 1
> bridgeEndpoint: true
> throwExceptionOnFailure: false
> This is failing when using *quarkus* runtime. I've sourced my .env before
> running camel run/export, still fails.
>
> It does NOT fail when using it in *to:* component.
>
> I use this convention to wire the application so that it can more easily be
> consumable by K8s to set the environment variables.
>
>
> Error:
> {code:java}
> org.apache.camel.FailedToCreateRouteException: Failed to create route:
> get-location at: >>>
> DynamicTo[toD[https://{{my.host}}.domain.com/${exchangeProperty.location}?bridgeEndpoint=true&lean=1&throwExceptionOnFailure=false]]
> <<< in route:
> Route(get-location)[From[rest:get:/:/locations/{id}?routeId=... because:
> Unknown function: MY_HOST at location 8
> https://${MY_HOST}.domain.com/${exchangeProperty.location}?bridgeEndpoint=true&lean=1&throwExceptionOnFailure=false
> *{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)