Can someone please explain using what criteria one of these flows is selected at runtime?
Flow selection is the job of the
DefaultFlowChooser.chooseFlow() method. This method delegates to each flow's canHandle() method to check various qualities of service on the exchange to determine if the flow can handle that exchange. Below are links to the canHandle() method for each flow:
Notice that each method checks the qualities of service that are applicable which is where determines of that flow can handle the exchange.
Is a flow selected per container or at a finer granularity, e.g. per deployment?
Flows are selected on a per message exchange basis and is determined by the qualities of service that required by a given exchange.
What happens when e.g. I run a clustered FUSE ESB environment? Is the JMS flow automatically selected? When would it switch to JCA?
When running multiple instances of ServiceMix, the same flow selection process described above is used. Flows are selected based on the qualities of service required by a given message exchange. E.g., if a SU deployed in one instance of ServiceMix needs to send a message to a SU deployed in a different instance of ServiceMix, that remoteness is a quality of service that can only be handled by the JMS flow or the JCA flow.
There is a mapping of qualities of service to flows available in the ServiceMix docs here:
http://servicemix.apache.org/transactions.html
There's also a whole bunch of new info about clustering available in the ServiceMix docs here:
http://servicemix.apache.org/clustering.html
And finally does changing a flow require a restart?
If you change the configuration of a flow in the servicemix.xml, the ServiceMix container needs to be restarted.