The Synchronization REST module provides a convenient REST API for
publishing content from a source Magnolia instance (typically an author
instance) to a target Magnolia instance (typically a public instance).
It provides another way to synchronize content using the
Synchronization
module and start synchronization, monitor synchronizations and stop
synchronizations remotely through via a REST service.
The module allows you to publish a large amount of content selectively.
Only previously published content is transferred to the target instance.
You can use the module to add content to new public instances without
shutting down existing instances and impacting their ability to serve
content.
Command REST vs Sync REST
You could launch a synchronization with the command API of the
REST module. However,
using the Synchronization REST API to synchronize has several
advantages over the command REST API.
Command REST
Synchronous
The API will not return a result until the synchronization has
finished. Synchronizations may take some time to finish depending on the
amount of content.
Fixed configuration
Must be configured before launching a synchronization. The
synchronization command uses a
receiver defined in the
Synchronization module’s configuration. The receiver defines the target
Magnolia instance to send content to and can’t be passed to the
synchronization command.
Uncontrolled execution
It is possible to launch identical synchronizations to the same
instance if not carefully orchestrated. You can launch many
synchronizations simultaneously. Synchronizations adds load on the
source Magnolia instance; you can overload the source Magnolia instance
by launching too many synchronizations at the same time.
Sync REST
Asynchronous
A synchronization launched with the Synchronization
REST API returns immediately with a job ID and provides calls to check
on the status of the synchronization job (waiting for execution,
running, finished successfully and finished with errors).
In addition, if you need to define a site specific receiver using
workspace path mappings, you can define a template receiver in the
configuration of the Synchronization REST module and use the mappings in
the template to perform the synchronization.
No configuration
You can specify all the details of the synchronization (URL for the
Magnolia instance, workspace, path and more) when launching the
synchronization. No configuration is needed to start a synchronization.
Controlled execution
Using these policies, you can avoid overloading the source Magnolia
instance and prevent duplicate synchronizations of the same content to a
Magnolia instance.
The synchronization policy can be set to control synchronizations:
Allow only one synchronization at a time
Allow only one synchronization to a target Magnolia instance
Allow only one synchronization of a workspace to a target Magnolia
instance
Allow all requested synchronizations
Installing with Maven
Maven is the easiest way to install the module.
Add the following to your bundle:
Due to the fact that update/install tasks are not run from beta to final
versions there will be some manual steps if you were using one of the
beta releases.
RestSynchronizationCommand removed from final module. This is harmless
but the command node configuration will have to be removed manually
from the JCR configuration.
(i.e. /modules/synchronization-rest/commands)
2020-06-25 15:10:19,851 WARN magnolia.transformer.ClassPropertyBasedTypeResolver: Encountered the 'class' property but failed to resolved the type from its value: [info.magnolia.synchronization.commands.RestSynchronizationCommand]
Copy
Remove sender config
In case 1.9-beta3 was installed, the synchronization sender node will
have to be removed manually from JCR configuration.
(i.e. /modules/synchronization-core/commands/synchronization/synchronize/synchronizationSenderClass).