Apache camel 是否必须为单例的bean组件uri选项显式设置cache=true?

Apache camel 是否必须为单例的bean组件uri选项显式设置cache=true?,apache-camel,Apache Camel,使用SpringApplicationContextRegistry,我知道在bean定义中,默认情况下作用域是单例的。因此,在下面的示例中,scope属性是冗余的 <bean id="heartbeatHandler" class="org.cybersecurity.ewf.HeartbeatHandler" scope="singleton"/> 但在下面的“ToURI”中,我想确认是否需要显式设置cache=true <to uri="bean:heartBeat

使用SpringApplicationContextRegistry,我知道在bean定义中,默认情况下作用域是单例的。因此,在下面的示例中,scope属性是冗余的

<bean id="heartbeatHandler" class="org.cybersecurity.ewf.HeartbeatHandler" scope="singleton"/>

但在下面的“ToURI”中,我想确认是否需要显式设置cache=true

<to uri="bean:heartBeatHandler?method=respondToHeartBeat&cache=true"/>


为什么需要设置为2个位置?

使用单例bean不需要设置
scope=“singleton”
cache=true
。这是默认的


缓存只是缓存注册表查找。

非常感谢Petter的澄清。