EndpointConfiguration in Apache camel after 2.19.0 version deprecated

345 Views Asked by At

In our application we were using older camel version where EndpointConfiguration interface and getEndpointConfiguration() method are referenced [Returns the object representation of the endpoint configuration].

From 2.19.0 camel version we see it's deprecated. Is there any alternate class/method help us in achieving the same functionality. Kindly advise.

Ideally If we get any class/method/method where we can get value at runtime and form the URI dynamically will solve our problem.

1

There are 1 best solutions below

0
Deepti Ranjan Pradhan On

In camel3x

the method getEndpointConfiguration() is removed from Endpoint class

the class EndpointConfiguration is removed

also there is no getParameter(Stirng parameter) available any where else which can return Endpoint's parameter (as per my knowledge)

Inside my custom processor :-

Previously my code was like

Endpoint fromEndpoint = exchange.getFromEndpoint();
String noop=fromEndpoint.getEndpointConfiguration().getParameter("noop");

Now in camel3x my code is

Endpoint fromEndpoint = exchange.getFromEndpoint();
String fullEndpointUri = fromEndpoint.getEndpointUri();
URI uri = new URI(fullEndpointUri);
Map<String, Object> parameters = URISupport.parseParameters(uri);
String password =(String)parameters.get("noop");

If any one have better implementation please advise.