Member since
06-14-2023
95
Posts
33
Kudos Received
9
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
1067 | 11-04-2024 06:51 PM | |
5276 | 12-29-2023 09:36 AM | |
7983 | 12-28-2023 01:01 PM | |
1570 | 12-27-2023 12:14 PM | |
907 | 12-08-2023 12:47 PM |
04-28-2025
10:40 PM
@joseomjr your code could not work at my end. ChatGPT help me with below code and it is working at my end. import java.util.zip.ZipInputStream
import java.util.zip.ZipEntry
import java.io.ByteArrayOutputStream
def flowFile = session.get()
if (!flowFile) return
try {
session.read(flowFile, { inputStream ->
ZipInputStream zipIn = new ZipInputStream(inputStream)
ZipEntry entry = zipIn.nextEntry
while (entry != null) {
if (!entry.isDirectory()) {
ByteArrayOutputStream baos = new ByteArrayOutputStream()
byte[] buffer = new byte[8192]
int len
while ((len = zipIn.read(buffer)) > 0) {
baos.write(buffer, 0, len)
}
def contentBytes = baos.toByteArray()
def newFlowFile = session.create(flowFile)
newFlowFile = session.write(newFlowFile, { outStream ->
outStream.write(contentBytes)
} as OutputStreamCallback)
newFlowFile = session.putAttribute(newFlowFile, 'filename', entry.getName())
session.transfer(newFlowFile, REL_SUCCESS)
}
zipIn.closeEntry()
entry = zipIn.nextEntry
}
} as InputStreamCallback)
session.remove(flowFile)
} catch (Exception e) {
log.error("Failed to unzip FlowFile due to: ${e.message}", e)
session.transfer(flowFile, REL_FAILURE)
} I hope there is no security concern with this code!
... View more
04-07-2025
03:03 AM
hello Sir, I have just setup a basic NiFi custom processor. when i try to build, one of the module gets built but the nar module fails with error [[1;31mERROR[m] [1;31mRule 3: org.apache.maven.enforcer.rules.dependency.RequireReleaseDeps failed with message:[m [[1;31mERROR[m] [1;31mDependencies outside of Apache NiFi must not use SNAPSHOT versions[m [[1;31mERROR[m] [1;31mcom.example:nifi-my_custom_nifi_processor-nar:nar:1.0-SNAPSHOT[m [[1;31mERROR[m] [1;31m com.example:nifi-my_custom_nifi_processor-processors:jar:1.0-SNAPSHOT <--- is not a release dependency
... View more
11-06-2024
10:47 PM
2 Kudos
@joseomjr , Thank you for responding, I instead chose a hard way approach. I thought why not create a custom Nar, which takes in 2 parameters, 1 for the json template with placeholders and 2 with its respective values. used sort of a recursion to create the final output. for and input like Template {"details":{"name":"${name}","age":"${age}","superpower":"${superpower}"}} value : {"name": "Clark Kent", "age": "35","superpower": "Superman"} gives output as { "details": { "name": "Clark Kent", "age": "35", "superpower": "Superman" } }
... View more
11-04-2024
06:51 PM
1 Kudo
The Groovy processor takes the incoming FlowFile and does stuff with it and writes a new FlowFile with the repsonse. What I tried was a JSON upload but will try "multipart/form-data" if I get a chance and see how that looks.
... View more
11-04-2024
06:09 AM
2 Kudos
@shiva239 You can create an apache "NiFi" jira in the Apache community to highlight this new feature and request modification to existing processor to support it. https://issues.apache.org/jira/ The more detail you provide in your jira the better chance someone might take this on in the community. Please help our community thrive. If you found any of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "Accept as Solution" on one or more of them that helped. Thank you, Matt
... View more
11-02-2024
06:26 PM
2 Kudos
You can achieve the same with a JOLT shift and this spec: {
"*": "&",
"meHostName": {
"*;*": {
"$(0,1)": "case",
"$(0,2)": "devicename"
}
}
}
... View more
07-23-2024
06:41 AM
I referred to the other article because of the custom listSFTP processor. This would make it possible to use only one PG with the workflow "move file from A to B", read the job configuration by any other processor, put the config values on a flowfile and pass it to this listSFTP processor.
... View more
05-28-2024
05:51 AM
Apparently in the github repo, there's a folder for processor example of base level, though it might not cover everything yet, might be a good place to solve basic issues. I had issues building a custom relationship as well, then I saw this example, which helped. Official Python Processor Examples
... View more
04-09-2024
02:02 PM
1 Kudo
Looks like NiFi is might be using GitHub - redis/jedis: Redis Java client under the covers so if it can run the commands you asked about, you might be able to build a custom Groovy processor to run them.
... View more