- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Retrieve Value of Signal Counter in Wait/Notify Processes
- Labels:
-
Apache NiFi
Created on ‎08-25-2020 02:11 PM - edited ‎08-25-2020 02:16 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using a wait/notify process to trigger a notification indicating that a group of FlowFiles has completed processing. I am using multiple Signal Counter Names (e.g. failed, succeeded) and FlowFiles are released by the corresponding Wait processor once the sum total of all the unique Signal Counters for a given Release Signal Identifier equals the Target Signal Count (in this case, the target signal count is equal to the number of FlowFiles that must be processed.
Below is an example of my wait processor configured to use the attribute "keyId" (shared across all related FlowFiles) as the Release Signal Identifier and update the Signal Counter named "succeeded" under the given Release Signal Identifier.
I would like to be able to query the value of a specific Signal Counter (e.g. succeeded) for a given Release Signal Identifier from the DistributedMapCache configured in the Wait/Notify processors. Is this possible, and if so, how can I do this (preferably using built in NiFi components or alternatively in Groovy)?
Created ‎10-12-2020 10:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@rstewart Counter is in-memory content for NiFi service. There is no direct way to get value of particular counter. But you can try below call to get a json response from NiFi about all counters.
curl -v -X GET "https://$HOSTNAME:9091/nifi-api/counter" -H "Authorization: Bearer $TOKEN" -H "Connection: close" -k
Once you get the Json response you can parse it as per your use case
