@Override
        public void endEmbeddedDocument(ContentHandler contentHandler, Metadata metadata) throws SAXException {
            metadata.add(TikaCoreProperties.TIKA_CONTENT, contentHandler.toString());
            try {
                metadataFilter.filter(metadata);
            } catch (TikaException e) {
                throw new SAXException(e);
            }
            try {
                jsonWriter.add(metadata);
            } catch (IOException e) {
                throw new SAXException(e);
            }
        }
This uses the {@link JsonStreamingSerializer} to write out a
single metadata object at a time.
tika-batch/src/main/java/org/apache/tika/batch/fs/StreamOutRPWFSConsumer.java