簡體   English   中英

2.19.0 版本棄用后 Apache camel 中的 EndpointConfiguration

[英]EndpointConfiguration in Apache camel after 2.19.0 version deprecated

在我們的應用程序中,我們使用舊的 camel 版本,其中引用了 EndpointConfiguration 接口和 getEndpointConfiguration() 方法[返回端點配置的對象表示]。

從 2.19.0 camel 版本開始,我們看到它已被棄用。 是否有任何替代類/方法可以幫助我們實現相同的功能。 好心提醒。

理想情況下,如果我們得到任何可以在運行時獲取價值並動態形成 URI 的類/方法/方法,將解決我們的問題。

在 camel3x 中

方法 getEndpointConfiguration() 已從 Endpoint 類中刪除

刪除了 EndpointConfiguration 類

也沒有 getParameter(Stirng parameter) 在其他任何可以返回 Endpoint 參數的地方可用(據我所知)

在我的自定義處理器中:-

以前我的代碼就像

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

現在在 camel3x 我的代碼是

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");

如果哪位有更好的實現請指教。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM