I'd like to propose that ChannelProcessor and ChannelSelector go away in favor of a simplified composite channel based implementation.
Today, fan out and content based routing (CBR, or technically header based routing) is implemented via the ChannelProcessor and ChannelSelector. While this works, it special cases these ideas. I propose we:
- Create a Channel implementation called FanOutChannel that takes a list of Channels.
- Its Transaction implementation simply delegates to the inner channel's transactions.
- The semantics remain the same.
In other words:
This preserves the semantics and drastically simplifies the code. The notion of required and optional channels are just conditions in the catch blocks within the composite Transaction impl (i.e. to rethrow or not to rethrow).
This works for CBR and other composite cases.