Reputation: 13
I want to get each flowfile from queue in connection when the flow was blocked with NiFi REST API.
I find that the functions of /nifi-api/flowfile-queues/{id}/listing-requests
can meet my needs.And it response a ListingRequestDTO:
enter image description here
The field named flowFileSummaries can return a array of flowFile.And then I can get each uuid from flowfiles:
{
"uri": "value",
"uuid": "value",
"filename": "value",
"position": 0,
"size": 0,
"queuedDuration": 0,
"lineageDuration": 0,
"clusterNodeId": "value",
"clusterNodeAddress": "value",
"penalized": true
}
BUT,when I use the API and can not find the "FlowFileSummary"
{
"listingRequest": {
"id": "0165122a-e1ac-134e-2c09-92ba9ca93e8b",
"uri": "http://.../nifi-api/flowfile-queues/07a23828-d6f3-1e00-27af-f0428a493507/listing-requests/0165122a-e1ac-134e-2c09-92ba9ca93e8b",
"submissionTime": "09/07/2018 18:46:57.496 CST",
"lastUpdated": "18:46:57 CST",
"percentCompleted": 0,
"finished": false,
"maxResults": 100,
"state": "Waiting for other queue requests to complete",
"queueSize": {
"byteCount": 370689,
"objectCount": 995
},
"sourceRunning": false,
"destinationRunning": false
}
}
So, is there any possible solution to achieve? or any other solution? Thanks!
Upvotes: 1
Views: 3944
Reputation: 1
You do not need to have the listing request to complete. Here are the steps I used successfully to get the contents of flow file
Note: if there are multiple flow files, you will see see multiple URIs in the response of step 3 curl command
Upvotes: 0
Reputation: 12093
I don't believe the flow file summaries are available until the listing request is complete. In your example response above, note that finished
is false. You can keep querying the API for that listing request until finished
is true, then the summaries should be available. Then you can use the /flowfile-queues/{id}/flowfiles/{flowfile-uuid}
and /flowfile-queues/{id}/flowfiles/{flowfile-uuid}/content
endpoints to get the attributes and content of each flow file.
Upvotes: 3