Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.1.0
-
None
-
None
Description
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:
class FanOutChannel: List<Channels> channels; getTx: tx = new FanOutTransaction() for ch in channels: txns.add(ch.getTx()) return tx class FanOutTransaction implements Transaction: List<Transaction> txns; begin: for tx in txns: tx.begin() commit: for tx in txns: tx.commit() ...
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.