Java 如何使用setter在apachecamel中设置端点的属性?

Java 如何使用setter在apachecamel中设置端点的属性?,java,apache,apache-camel,dsl,Java,Apache,Apache Camel,Dsl,我想为端点设置一些属性,如下所示 from().to().setProperty(超时,常量(12)) 如上所述使用setProperty,它正在将属性设置为exchange/message对象? 如何在端点本身中检索此属性,或者如何为端点设置它(而不是通过在URI中传递它) 我知道我们可以将其传递给端点URI。但是,我只想知道是否有一种方法可以借助setter进行设置。如果您想为from端点设置属性,可以按如下方式进行: CxfEndpoint endpoint = (CxfEndpoint)

我想为端点设置一些属性,如下所示

from().to().setProperty(超时,常量(12))

如上所述使用setProperty,它正在将属性设置为exchange/message对象? 如何在端点本身中检索此属性,或者如何为端点设置它(而不是通过在URI中传递它)


我知道我们可以将其传递给端点URI。但是,我只想知道是否有一种方法可以借助setter进行设置。

如果您想为from端点设置属性,可以按如下方式进行:

CxfEndpoint endpoint = (CxfEndpoint) new CxfComponent(this.getContext()).createEndpoint(<uri>);
endpoint.setxxx // here you can configure your endpoint with setters

from(endpoint)...
CxfEndpoint端点=(CxfEndpoint)新的CxfComponent(this.getContext()).createEndpoint();
endpoint.setxxx//您可以在此处使用setter配置端点
从(端点)。。。

谢谢你的回答:)如果你认为这个答案有帮助,你能接受吗?