Hi @nitinfuture, in general overriding OOTB CommandServlet is not a good approach. The main reason for that is you can affect other functionalities that use this servlet, this approach could also get you in trouble after AEM upgrade (i.e. installing SP). Below you can find some options including the one that should allow you to use your servlet.
- If you still want to use your implementation of CommandServlet, you can try to manipulate service.ranking property. You can also use ACS Commons OSGi Component Disabler to switch off OOTB CommandServlet - this will guarantee only your servlet will be available. Nevertheless all options described in this point are not recommended.
- You can use replication API, .e.g Preprocessor and AgentFilter, this will allow you to control which replication agent should be used, e.g. base on agent id or other criteria/rules.
- I am not sure what is exactly the case, but this also could be an option. If you would like to use different replication agents for different content paths. The easiest way will be to create dedicated users that will be used by each agent. Each user should have permission only to specific content path. In other words each agent will be able to replicate content from path to which it has permission.