Member since
05-19-2025
9
Posts
0
Kudos Received
3
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 283 | 10-24-2025 06:49 AM | |
| 230 | 10-24-2025 04:45 AM | |
| 383 | 06-06-2025 04:51 AM |
10-24-2025
06:49 AM
We are running the following: Cloudera Flow Management (CFM) 2.1.7.1001 1.26.0.2.1.7.1001-5 built 07/03/2024 09:38:52 EDT Powered by Apache NiFi 1.26.0 I have 4 CRON driven processors that drive their respective process flows. 3 of the processors have execute 6pm weekdays (0 0 18 ? * MON-FRI) with no issues. This one executes at 5pm as expected, but also executes at 4:07pm which is strange. This is on a single core in our development environment. We are not using clusters. Also, since this is our development core, only I have access at this time. And I did not manually execute the processor. And I just realized that our old Windows Service process is executing in development and that the 4:07pm emails came from it and not the Nifi CDF process we are developing and testing. So this is resolved and in no way an issue with Cloudera or Nifi.
... View more
10-24-2025
04:45 AM
I found the solution. While the code did validate the XML to the schema, I needed to add a conditional statement to transfer to failure: import groovy.xml.XmlSlurper import groovy.xml.XmlUtil import javax.xml.transform.stream.StreamSource import javax.xml.validation.SchemaFactory import javax.xml.XMLConstants import org.xml.sax.ErrorHandler import org.xml.sax.SAXParseException def flowFile = session.get() if (!flowFile) return def fileXML = flowFile.read().getText("UTF-8") def xmlContent = new XmlSlurper().parseText(fileXML.trim().replaceFirst("^([\\W]+)<","<").replaceAll('\'','\'\'')) def schemaFile = flowFile.getAttribute('XMLSchema') def schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI) def schema = schemaFactory.newSchema(new File(schemaFile)) def validator = schema.newValidator() def validationErrors = new StringBuilder() validator.setErrorHandler(new ErrorHandler() { @Override void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException { validationErrors.append("<p>Warning: ${e.message}</p>") } @Override void error(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException { validationErrors.append("<p>Error: ${e.message}</p>") } @Override void fatalError(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException { validationErrors.append("<p>Fatal Error: ${e.message}</p>") } }) try { validator.validate(new StreamSource(new StringReader(XmlUtil.serialize(xmlContent)))) if (validationErrors.length() > 0) { flowFile = session.putAttribute(flowFile, "xml.validation.errors", validationErrors.toString()) session.transfer(flowFile, REL_FAILURE) } else { session.transfer(flowFile, REL_SUCCESS) } } catch (org.xml.sax.SAXParseException e) { validationErrors.append("Validation failed: ${e.message}\n") flowFile = session.putAttribute(flowFile, "xml.validation.errors", validationErrors.toString()) session.transfer(flowFile, REL_FAILURE) }
... View more
06-06-2025
04:51 AM
Turns out the issue is because of the NVARCHAR(MAX) as the processor and JDBC driver cannot seem to properly handle it as the string being stuffed is too large. I ended up returning all rows into an ExecuteGroovyScript processor and then concatenating all the validation errors into a single string.
... View more
05-26-2025
07:28 AM
Thanks for clarifying the ListFile vs Get<abc> usage in cluster mode. That load-balancing tip really helps when scaling out. I’ll definitely try adjusting the image size next time too, didn’t realize it could be dragged larger before replying.
... View more