Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Current replication code treats differently the forward and reverse replication. Forward replication creates a content package, adds it to a queue and transports it to the other instance while reverse replication creates a dummy POLL package, transports it to the other instance, retrieves the result queues it and then installs it in the current instance.
The current flow for reverse replication complicates the code structure and can be simplified by using three main entities:
1. Package Importers: can import(install) a replication package
1.a ReplicationPackageImporter
1.b ReplicationPackageImporterServlet bound to replication/importer resource type
1.c http://localhost:4502/libs/sling/replication/importers.json
2. Package Exporters - can export (create) a replication package
2.a ReplicationPackageExporter
2.b ReplicationPackageExporterServlet bound to replication/exporter resource type
2.c http://localhost:4502/libs/sling/replication/exporters.json
3. Replication Agents - coordinate the interaction between an exporter and an importer using the following flow: exports a package, adds it to a queue, and the imports the package.
3.a ReplicationAgent
3.b ReplicationAgentServlet bound to replication/agent resource type
3.c http://localhost:4502/libs/sling/replication/agents.json
Basically for forward replication the exporter is local and the importer is remote while for reverse replication the difference is that the exporter is remote and the importer is local.