Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-3688 Add Zookeeper Support
  3. INT-3617

Support Start/Stop Endpoints Based on ZK Leadership

    XMLWordPrintable

    Details

      Description

      Consider the use case of n inbound channel adapters polling a shared resource with one being active at a time.

      Use ZooKeeper to maintain the state - use curator's LeaderLatch or LeaderSelector abstraction (XD uses the latter).

      For example, an <int-zk:leader-inbound-channel-adapter/> could emit a message when elected leader. The message can be transformed and routed to a control-bus to start one or more channel adapters.

      Similarly when leadership is lost (or not gained) stop the adapter(s).

      Also, to solve the issue "Leader Election and External Resources" in chapter 5 of O'Reilly's "ZooKeeper", also add a ZkFenceAwarePollerAdvice to the poller(s) (or code directly in SPCA) such that the poller can check to verify that this instance really is still the master at the time of the poll.

      The leader adapter can pass the czxid of the node in a header of the @adapter.start() message.

        Attachments

          Activity

            People

            Assignee:
            grussell Gary Russell
            Reporter:
            grussell Gary Russell
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: