Expand my Community achievements bar.

SOLVED

Reverse Replication skipping items

Avatar

Level 8

I have a custom servlet that captures a form submission and sets cq:lastModified, cq:lastModifiedBy and cq:distribute (to true).  I ran a few tests and i'm noticing that not all of the submitted content is being reverse replicated back to the author.  Out of 99 submissions, only 79 made it back to the author.  I checked the publish instances (there are 2), one has 49 posts and one has 50 posts.  Has anyone encountered this or have any help they could provide?

1 Accepted Solution

Avatar

Correct answer by
Level 10

this is the right way to do as all the UGC will be stored in 'outbox'

View solution in original post

5 Replies

Avatar

Level 8

I saw this post https://forums.adobe.com/thread/1111532 and moved my save to before the reverse replicating node values were set and then obviously added another after - this didn't really help.  The next attempt i had 87 or 99 reverse replicated.

Avatar

Level 10

Are you getting any log messages that provide clues about why not all content is being reserved replicated?  

Avatar

Level 8

Not that are helpful.  I have an email service that triggers when a new submission comes in and i see that in certain cases these emails are being triggered but the *INFO* logs for creating an outbox item are not created, so to me that says that something is failing to trigger the reverse replication process.  The code is below for the reverse replication.

//Page/Node creation here session.save(); pageContainer.setProperty("hideInNav", true); pageContainer.setProperty("cq:lastModified", Calendar.getInstance()); pageContainer.setProperty("cq:lastModifiedBy", session.getUserID()); pageContainer.setProperty("cq:distribute", true); session.save();

Avatar

Level 8

I switched up my code to use the replication service instead.  I found this example on Stackoverflow.  Once implemented, all of my submissions were successfully reverse replicated.  Is there any reason i shouldn't be using this method?

//pageContainer.setProperty("hideInNav", true); //pageContainer.setProperty("cq:lastModified", Calendar.getInstance()); //pageContainer.setProperty("cq:lastModifiedBy", session.getUserID()); //pageContainer.setProperty("cq:distribute", true); AgentIdFilter filter = new AgentIdFilter("outbox"); ReplicationOptions opts = new ReplicationOptions(); opts.setFilter(filter); replicator.replicate(session, ReplicationActionType.ACTIVATE, pageContainer.getPath(), opts);

Avatar

Correct answer by
Level 10

this is the right way to do as all the UGC will be stored in 'outbox'