I'm developing one camel application in which I want to keep scope of beans at route level. Meaning that, if I call one bean from two different routes two instances should get created.But within that route same single instance should be used for that bean. Following is my code:
<bean id="testbean" class="testClass"> </bean>
<camelContext id="test"
xmlns="http://camel.apache.org/schema/blueprint">
<route id="1">
<from uri="timer"/>
<to uri="bean:test"/>
</route>
<route id="2">
<from uri="timer"/>
<to uri="bean:test"/>
</route>
</camelContext>
Here in route 2 separate bean instance should get created. Please suggest if have any idea.