使用URI配置替代EndpointConfiguration。以下是代码示例:
在旧版本中,我们可能会使用EndpointConfiguration来设置终端点:
EndpointConfiguration config = new EndpointConfiguration("http://localhost:8080/myservice", camelContext); from(config).to("log:out");
但是在2.19.0版本之后,EndpointConfiguration已被弃用。相反,我们应该使用URI来配置终端点,以下是示例代码:
from("http://localhost:8080/myservice").to("log:out");
通过使用URI来设置终端点,我们可以减少冗余的代码并提高可读性。