I would like to enable or disable an HTTP proxy dynamically based on a YAML property.
service:
useHttpProxy: "true"
HTTP Request Config:
I get the following error:
Unable to convert 'proxyConfig' with class 'java.lang.String'
to class 'HttpProxyConfig'
WriterExecutionException:
Unable to convert 'proxyConfig' with class 'java.lang.String'
to class 'HttpProxyConfig'
My understanding is that the proxyConfig attribute expects an HttpProxyConfig object, while my expression returns a String ("proxyConfig").
Questions:
Is it possible to dynamically set the
proxyConfigattribute using a DataWeave expression?If not, what is the recommended Mule 4 approach for enabling/disabling proxy usage via a YAML property?
Do I need two separate
http:request-configdefinitions (one with a proxy and one without) and select the appropriate one at runtime?
