Member since
02-01-2022
285
Posts
103
Kudos Received
60
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 1181 | 05-15-2025 05:45 AM | |
| 5109 | 06-12-2024 06:43 AM | |
| 8112 | 04-12-2024 06:05 AM | |
| 5991 | 12-07-2023 04:50 AM | |
| 3294 | 12-05-2023 06:22 AM |
07-20-2022
08:23 AM
I think you will also need to do the transfer/commit in the each list logic
... View more
07-20-2022
08:22 AM
@rangareddyy You will need to add attributes to the flowfile: flowFile = session.putAttribute(flowFile, 'myAttr', 'myValue') Reference: https://community.cloudera.com/t5/Community-Articles/ExecuteScript-Cookbook-part-1/ta-p/248922
... View more
07-20-2022
08:09 AM
This is a groovy error. I would suggest having a working groovy script executeable outside of nifi before trying to modify and execute that code in the context of ExecuteScript.
... View more
07-20-2022
07:27 AM
1 Kudo
@rangareddyy I recently did something similar, and each time, in the code, that i wanted to send flowfile i used: session.transfer(flowFile2, REL_SUCCESS) session.commit() It is my understanding in a single flowfile example, the commit() is inferred upon script completion.
... View more
07-20-2022
06:54 AM
@SandyClouds ofcourse you can, you will need to use CLI: https://nifi.apache.org/docs/nifi-docs/html/toolkit-guide.html Ofcourse you can do all this manually, but creating 100 flows one at a time would be a nitemare to create and manage..
... View more
07-20-2022
05:37 AM
@cnelson2 This is legit! Excellent work my friend!!
... View more
07-20-2022
05:29 AM
@SandyClouds Since CaptureChangeMysql does not accept incoming flowfiles you would have to create a separate CaptureChangeMysql flow for each database. This would be exhaustive on 100s of manually created flows. I would have to automate the creation of these flows in a normal nifi environment. In some of the CDC demos I am working with now, i am using CDP Public Cloud Data Flow and able to paramaterize my flows and create flow definitions that are very dynamic then deploy them without touching NiFi or NiFi API and only changing the parameters. This would be an interesting approach to solving 100s of data flows. Another approach I use to begin CDC conversations without actually using "CDC" is to use ExecuteSQL which does accept incoming flowfiles. I use this to grab an entire database and all tables, put all the data in kafka, and all the schema in Schema Registry. This enables me to start to build deeper CDC logic around the same data, including using the same kafka topic per table for updates from other systems, then ultimately deciding how to handle deletes. That said, the complications in creating and operating these types of flows are only enabled when you begin to start capturing data. To me CDC is a journey, not a destination, and we can only begin down that path when we start putting the above concepts in place whether that is CaptureChangeMysql or ExecuteSql with deeper logic for handling changes of the source database.
... View more
07-20-2022
05:14 AM
@AbhishekSingh I believe you can accomplish this with some very complicated Expression Language chaining. It is possible to have many Expression Languages combined into one expression. Reference: https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html I do not have time to prove this out, but in theory, you would combine lesson learned in your other post (expression language to change the database.table with Replace, ifElse and maybe Equals to get your desired outcome.
... View more
07-20-2022
05:02 AM
@AbhishekSingh It looks like the issue with the Replace Expression Language was just the ` around the database and table name. That works for me as follows: ${query:replace('`nrpuserorgdb2306`.`status`', '`nrpreportdb`.`user_org_status`')} Here is my flow to test: Notice the use of a simple flow to test the concept. I also set query in GenerateFlowfile and define a separate query2 in UpdateAttribute. I always work in ways that prove functionality, then when the concept is working, take the lesson learned into real flows. Some additional Screen Shots: Template and Flow Definition File on my GitHub: https://github.com/cldr-steven-matison/NiFi-Templates
... View more
06-23-2022
09:47 AM
@araujo It would be awesome if you could also link a flow definition file....
... View more