private void emitParseData(FetchEmitTuple t, MetadataListAndEmbeddedBytes parseData) {
        long start = System.currentTimeMillis();
        String stack = getContainerStacktrace(t, parseData.getMetadataList());
        //we need to apply the metadata filter after we pull out the stacktrace
        filterMetadata(t, parseData.getMetadataList());
        filterMetadataList(t, parseData);
        ParseContext parseContext = t.getParseContext();
        FetchEmitTuple.ON_PARSE_EXCEPTION onParseException = t.getOnParseException();
        EmbeddedDocumentBytesConfig embeddedDocumentBytesConfig = parseContext.get(EmbeddedDocumentBytesConfig.class);
        if (StringUtils.isBlank(stack) ||
                onParseException == FetchEmitTuple.ON_PARSE_EXCEPTION.EMIT) {
            injectUserMetadata(t.getMetadata(), parseData.getMetadataList());
            EmitKey emitKey = t.getEmitKey();
            if (StringUtils.isBlank(emitKey.getEmitKey())) {
                emitKey = new EmitKey(emitKey.getEmitterName(), t.getFetchKey().getFetchKey());
                t.setEmitKey(emitKey);
            }
            EmitData emitData = new EmitData(t.getEmitKey(), parseData.getMetadataList(), stack);
            if (embeddedDocumentBytesConfig.isExtractEmbeddedDocumentBytes() &&
                    parseData.toBePackagedForStreamEmitter()) {
                emit(t.getId(), emitKey, embeddedDocumentBytesConfig.isExtractEmbeddedDocumentBytes(),
                        parseData, stack, parseContext);
            } else if (maxForEmitBatchBytes >= 0 &&
                    emitData.getEstimatedSizeBytes() >= maxForEmitBatchBytes) {
                emit(t.getId(), emitKey, embeddedDocumentBytesConfig.isExtractEmbeddedDocumentBytes(),
                        parseData, stack, parseContext);
            } else {
                //send back to the client
                write(emitData);
            }
            if (LOG.isTraceEnabled()) {
                LOG.trace("timer -- emitted: {} ms", System.currentTimeMillis() - start);
            }
        } else {
            write(STATUS.PARSE_EXCEPTION_NO_EMIT, stack);
        }
    }
returns stack trace if there was a container exception or empty string
if there was no stacktrace

@param t
@param metadataList
@return
tika-core/src/main/java/org/apache/tika/pipes/PipesServer.java