Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

AEM 6.2 More than one Replication Preprocessor implementations

Avatar

Level 1

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
   }

}

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

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

Avatar

Level 1

@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