This ticket is about contributing a resource based implementation of the discovery api (see ) named discovery.impl to Sling. The implementation is attached as a .tar.gz - its md5 hash is d8891e5401114b2a629d3ff01044a1d6
Short description of the discovery.impl:
The discovery.impl is an out-of-the-box implementation of the discovery.api using standard features of Sling. The discovery.api provides a view of a topology consisting of a number of individual sling-instances. The instances are loosely coupled, except for being part of the topology they do not implicitly or necessarily share anything else. For those instances though that form a cluster - ie when connected to the same repository - the api has an abstraction called ClusterView.
The discovery.impl uses two mechanisms for discovering other instances:
- it stores information about the local instance at a unique location in the repository. Thus allowing other instances that access the same repository to see and recognize each other.
- it connects to 'remote' instances via a plain HTTP POST, announcing the instances that it can see, and getting back the instances of the counterpart
All of the above is done regularly using a heart-beat - thus allowing to get a view of the currently live instances.
The discovery.api additionally supports leader-election within a cluster: it ensures that one and only one instance is elected leader and stays leader until it disappears/shuts down/dies. The discovery.impl uses repository-based voting between the instances of a cluster to establish a common 'cluster view'. Based on an established view, the discovery.impl is then able to deterministically elect one of the instances of the view as the leader (namely the one with the lowest 'id').
Also, to support the PropertyProvider concept of the discovery.api, the properties of each instance are propagated to the other instances using the heartbeat as piggyback (either via the repository or via HTTP POSTs for remote instances).
To get an idea of the discovery.impl build and add and start the two bundles (org.apache.sling.discovery.api and org.apache.sling.discovery.impl) to your sling installation and open the browser to the provided, simplistic 'topology webconsole' at
Please let me know if anything needs further explanation, details. Looking forward to having this included in Sling!
|Assignee||Carsten Ziegeler [ cziegeler ]|
|Status||Open [ 1 ]||Resolved [ 5 ]|
|Resolution||Fixed [ 1 ]|
|Fix Version/s||Discovery Impl 1.0.0 [ 12324346 ]|
|Workflow||no-reopen-closed,doc-test-required [ 12777403 ]||re-open possible,doc-test-required [ 12790207 ]|
|Workflow||re-open possible,doc-test-required [ 12790207 ]||no-reopen-closed,doc-test-required [ 12792566 ]|
|Status||Resolved [ 5 ]||Closed [ 6 ]|
|Transition||Time In Source Status||Execution Times||Last Executer||Last Execution Date|
|22d 23h 18m||1||Carsten Ziegeler||10/May/13 18:25|
|93d 17h 56m||1||Carsten Ziegeler||12/Aug/13 12:21|