I'm using camel with spring. One of our routes should send a TCP message to a dynamically selected endpoint. As the endpoint is just a string, I know I can use
.toD("netty4://...")
but the problem is with setting ssl parameters.
Netty component defines this as route url parameter so it looks like this:
.toD("netty4://...?sslContextParameters=mySslContextParameters");
and to make this work I have a bean:
@Bean
public SslContextParameters mySslContextParameters() {
...
return sslContextParameters();
}
This binds it to this single bean instance but what I need, is a dynamically configured bean so that I may set different parameters of the SSL based on some data I get from the producer.
What I would like is something like this (I know this is not proper camel syntax), when I could invoke a factory method and pass some parameters to it:
.toD("netty://...?sslContextParameters=${bean('mySslContestParameters(${exchange.param1}, ${exchange.param2}')}");