Reputation: 625
I have a pair of camel routes that receive messages from two different queues, whose process is executed by the same bean (by reference). This is done via Spring & Camel XML.
The configuration looks as such:
<route id "route-1" xmlns="http://camel.apache.org/schema/spring">
<from uri="queue:IN1" />
<process ref = "myProcessBean />
</route>
<route id "route-2" xmlns="http://camel.apache.org/schema/spring">
<from uri="queue:IN2" />
<process ref = "myProcessBean />
</route>
If I get messages on both IN1 and IN2, will those messages be processed in parallel?
Upvotes: 0
Views: 731
Reputation: 139
Yes it would. A processor is a singleton bean and it can get processed in parallel. Just ensure that it doesn't store any state information within it, which is in fact one of the best practices suggested(Link below).
https://www.3riverdev.com/apache-camel-processors-should-never-be-stateful/
Upvotes: 2