Update BinFiles not to write attributes to FlowFiles for auto-terminated ORIGINAL relationship

Signed-off-by: Matt Burgess <mattyb149@apache.org>

This closes #8911
This commit is contained in:
Jim Steinebrey 2024-06-03 14:27:05 -04:00 committed by Matt Burgess
parent f9aefc2d5e
commit 5e3f1dbaf6
2 changed files with 6 additions and 2 deletions

View File

@ -252,7 +252,9 @@ public abstract class BinFiles extends AbstractSessionFactoryProcessor {
// If this bin's session has been committed, move on.
if (!binProcessingResult.isCommitted()) {
final ProcessSession binSession = bin.getSession();
if (!context.isAutoTerminated(REL_ORIGINAL)) {
bin.getContents().forEach(ff -> binSession.putAllAttributes(ff, binProcessingResult.getAttributes()));
}
binSession.transfer(bin.getContents(), REL_ORIGINAL);
binSession.commitAsync();
}

View File

@ -527,7 +527,9 @@ public class JoinEnrichment extends BinFiles {
// If this bin's session has been committed, move on.
if (!binProcessingResult.isCommitted()) {
final ProcessSession binSession = bin.getSession();
if (!context.isAutoTerminated(REL_ORIGINAL)) {
bin.getContents().forEach(ff -> binSession.putAllAttributes(ff, binProcessingResult.getAttributes()));
}
binSession.transfer(bin.getContents(), REL_ORIGINAL);
// Migrate FlowFiles to our batch session. Then commit the bin session to free up any resources