Uploaded image for project: 'Flume'
  1. Flume
  2. FLUME-1176

Fan out and CBR should be refactored to be composite channels

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.1.0
    • None
    • Channel, Technical Debt
    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            esammer Eric Sammer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: