Hi,
if you try to use a ReplicationListener i think that you are sure that the element is already published on the publish instance.
I put here a snippet that I use for my project:
package com.adobe.cq.listeners;
import com.day.cq.replication.*;
public class MyReplicationHandler implements ReplicationListener {
public void onStart(Agent agent, ReplicationAction replicationAction) {
//started
}
public void onMessage(ReplicationLog.Level level, String s) {
//put in the queue
}
public void onEnd(Agent agent, ReplicationAction replicationAction, ReplicationResult replicationResult) {
//replicated
}
public void onError(Agent agent, ReplicationAction replicationAction, Exception e) {
//failed
}
}
Let us know.
Thanks,
Antonio