AEM 6.2 More than one Replication Preprocessor implementations | Community
Skip to main content
November 8, 2017
Solved

AEM 6.2 More than one Replication Preprocessor implementations

  • November 8, 2017
  • 2 replies
  • 1704 views

We use AEM 6.2 and we have to implement two Replication Preprocessors (com.day.cq.replication.Preprocessor). When I include second preprocessor, the system is only executing the first one. When I delete the first one, second preprocessor executes properly.

I did not find enough documentation and samples on having more than one preprocessor implementation.

Could someone advise whether it is needed to configure some additional properties in order for all preprocessors to be launched?

Thank you.

Examples:

@Component(immediate = true, label = "Preprocessor 1")

@Service
public class ReplicationPreprocessor1 implements Preprocessor {

   @Override
   public void preprocess(final ReplicationAction replicationAction, final ReplicationOptions replicationOptions)

   throws ReplicationException {

   // Do something
   }

}

@Component(immediate = true, label = "Preprocessor 2")

@Service
public class ReplicationPreprocessor2 implements Preprocessor {

   @Override
   public void preprocess(final ReplicationAction replicationAction, final ReplicationOptions replicationOptions)

   throws ReplicationException {

   // Do something
   }

}

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 joerghoh

As far as I can see, all preprocessors are called as part of the replication in a loop. If you set "com.day.cq.replication.impl.ReplicatorImpl" to DEBUG, it will log the registering of the preprocessors, but sadly not the execution of the individual preprocessors.

But your code should work, and both preprocessors should be executed.

Jörg

2 replies

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
November 9, 2017

As far as I can see, all preprocessors are called as part of the replication in a loop. If you set "com.day.cq.replication.impl.ReplicatorImpl" to DEBUG, it will log the registering of the preprocessors, but sadly not the execution of the individual preprocessors.

But your code should work, and both preprocessors should be executed.

Jörg

November 14, 2017

@Jörg, thank you for your reply.

I found the reason why the second and other preprocessors are not executed properly.

ReplicationPreprocessor1 is registered, but has the 'satisfied' status as a component. That is why other preprocessors did not launch in a loop.

So this is our internal issue.

Thank you a lot,

Andrii