Global sync listener for scd? | Community
Skip to main content
MC_Stuff
New Participant
October 1, 2017
Solved

Global sync listener for scd?

  • October 1, 2017
  • 6 replies
  • 2877 views

Watching the great gems session [1] couple of times. It was mentioned scd can be used to sync any folder in AEM.  I have set up the scd correctly and able to sync /home correctly.  But anything outside /home does not sync.  However making explicit curl command [2] sync correctly any thing outside /home.  That means listener is missing to call distribution api of scd outside the /home directory.   Please let me know

  • Is there any explicit package needs to be installed Or if i missed any configuration to update?   (Note:- Allowed roots configuration in Queue distribution setting does not help)
  • If needs to develop own listener what are the guidelines ?
  • Any plans in product roadmap to have this feature to sync any folder using scd.

[1]  Troubleshooting Sling Content Distribution

[2]  curl -u admin:admin http://localhost:8081/libs/sling/distribution/services/agents/reverse-pubsync -d 'action=ADD' -d 'path=/content/sample1'

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by tmaret

You setup is probably missing a service that detects changes in the repository and triggers distribution requests (similar the example you shared [2]) upon changes.

You would need to develop a service that issues distribution requests via the APIs at

https://github.com/apache/sling/tree/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution

In particular, see the Distributor API

https://github.com/apache/sling/blob/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/Distributor.java

Syncing content is highly dependent on the content structure related to a specific use case, thus making a generic implementation is tricky.

To my knowledge, there is no plan to have generic sync feature implemented. You could implement sync for your own use case.

6 replies

October 8, 2018

Any sample code would be very helpful.

October 8, 2018

Hi MC Stuff,

could you please guide me what all I will have to write custom ?

I have user working fine in my system.

I want my /content/dam/xyz folder to be in sync.

I understand I need to write a listener, and how do I use distribution API in it ?

Regards,

Akash B.

MC_Stuff
MC_StuffAuthor
New Participant
October 3, 2017

thanks smacdonald2008 & @tmaret​.   We developed own & having another issue which i will post another thread ccing you. Please help.

Still I believe can be made genric. I have filled for enhancement request at acs commons  at  Content Sync Listener to trigger distribution workflow · Issue #1130 · Adobe-Consulting-Services/acs-aem-commons · GitHu… .If profession service feel importance will contribute the code there.

tmaretAccepted solution
Employee
October 3, 2017

You setup is probably missing a service that detects changes in the repository and triggers distribution requests (similar the example you shared [2]) upon changes.

You would need to develop a service that issues distribution requests via the APIs at

https://github.com/apache/sling/tree/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution

In particular, see the Distributor API

https://github.com/apache/sling/blob/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/Distributor.java

Syncing content is highly dependent on the content structure related to a specific use case, thus making a generic implementation is tricky.

To my knowledge, there is no plan to have generic sync feature implemented. You could implement sync for your own use case.

smacdonald2008
New Participant
October 2, 2017

Also - there are detailed Sling docs on this subject here: Apache Sling :: Content Distribution (org.apache.sling.distribution)

smacdonald2008
New Participant
October 2, 2017

We have asked the team that presented this to look at this question.