0
votes

I'm using Camel 2.18.1 and have a http4 route similar to

<to id="Http4Endpoint" uri="https4://{{servicename}}?sslContextParameters=mySslContext"/>

{{servicename}} is loaded via BridgePropertyPlaceholderConfigurer so that I can specify the endpoint in different environments.

The problem that I have just run into is that some of my test environments aren't https and the route fails as it seems to be trying to force https communication.

I've previously used jetty producers where you could specify http or https in {{ servicename }} and it auto-negotiated it however http4 seems to only allow the hostname:port.

How can I manage the localisation between different environments so that it will work with either a http or https endpoint?

Thanks

1
Why not inject the entire uri parameters as a placeholder? - Souciance Eqdam Rashti
I will probably go down that path but then it does make it more difficult for the downstream deployment team. They don't necessarily understand what http(s)4 or the sslContextParameters are etc. - Karl
You could off course inject in via environment variables depending on some condition. But I did something similar and we injected the entire uri string instead. You could off course load it from a property file as well if you wanted. - Souciance Eqdam Rashti

1 Answers

0
votes

You can use more placeholders in the uri, so you can just have another option to configure if its http or https.