With Spring ApplicationContextRegistry, I understand that in the bean definition, scope is singleton by default. So, in the example below, the scope property is redundant.
<bean id="heartbeatHandler" class="org.cybersecurity.ewf.HeartbeatHandler" scope="singleton"/>
But in the ‘to uri’ below, I want to confirm whether we need to explicitly set cache=true?
<to uri="bean:heartBeatHandler?method=respondToHeartBeat&cache=true"/>
Why do we need to set at 2 places?
You don’t need to set either
scope="singleton"orcache=trueto use singleton beans. It’s default.The cache just caches the registry lookup.