BatchListener<WriteBatch>voidprocessEvent (WriteBatch batch)The method called by WriteBatcher to run your custom code on this batch. You usually implement this as a lambda expression.
For example, see the lambda expression passed to onBatchSuccess:
WriteBatcher wb = dataMovementManager.newWriteBatcher(query)
.withBatchSize(1000)
.withThreadCount(20)
.onBatchSuccess(batch -> {
for ( WriteEvent doc : batch.getItems() ) {
if ( doc.getTargetUri().contains("/legal/") ) {
// do something
}
}
})
.onBatchFailure(throwable -> throwable.printStackTrace());
processEvent in
interface BatchListener<WriteBatch>batch - the batch of documents written and some
metadata about the current status of the jobCopyright (c) 2010-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.