Support Questions

Find answers, ask questions, and share your expertise

How can i see the Content of Flowfiles in queue using API

avatar
Rising Star

Hi, I have a use case, where i have to see the content of each FlowFiles by triggering the API call.

 

API i have explored so far :

https://<URL>/nifi-api/flowfile-queues/<Queue-ID>/flowfiles/<FlowFile-UUID>/content

 

I got the response as below : 

"The id of the node in the cluster is required."

 

Note : My NiFi is setting up in three node cluster.

 

Please suggest.

 

 

2 ACCEPTED SOLUTIONS

avatar

@samrathal Per the docs you need to provide the ID:

 

Request
consumes:
*/*
 

Name Location Type Description

idpathstringThe connection id.
flowfile-uuidpathstringThe flowfile uuid.
clusterNodeIdquerystringThe id of the node where the content exists if clustered.


You should be getting that ID from the previous get call (Gets a FlowFile from a Connection) within the

response is an object: 

FlowFileEntity

 

Inside is the "clusterNodeId" corresponding to which node that flowfile exists on.

 

{ "flowFile": { "uri": "value", "uuid": "value", "filename": "value", "position": 0, "size": 0, "queuedDuration": 0, "lineageDuration": 0, "penaltyExpiresIn": 0, "clusterNodeId": "value", "clusterNodeAddress": "value", "attributes": { "name": "value" }, "contentClaimSection": "value", "contentClaimContainer": "value", "contentClaimIdentifier": "value", "contentClaimOffset": 0, "contentClaimFileSize": "value", "contentClaimFileSizeBytes": 0, "penalized": true } }

 Those details are exposed in the nifi api doc, just be sure to click into the entity.

View solution in original post

avatar
Rising Star

Hi Everyone, the API would be :

 

GET https://<URL>/nifi-api/flowfile-queues/<id>/flowfiles/<flowfile-uuid>/content?clusterNodeId=<clusterNodeId>

 

You'll get the content of the FlowFile in the queue.

View solution in original post

3 REPLIES 3

avatar

@samrathal Per the docs you need to provide the ID:

 

Request
consumes:
*/*
 

Name Location Type Description

idpathstringThe connection id.
flowfile-uuidpathstringThe flowfile uuid.
clusterNodeIdquerystringThe id of the node where the content exists if clustered.


You should be getting that ID from the previous get call (Gets a FlowFile from a Connection) within the

response is an object: 

FlowFileEntity

 

Inside is the "clusterNodeId" corresponding to which node that flowfile exists on.

 

{ "flowFile": { "uri": "value", "uuid": "value", "filename": "value", "position": 0, "size": 0, "queuedDuration": 0, "lineageDuration": 0, "penaltyExpiresIn": 0, "clusterNodeId": "value", "clusterNodeAddress": "value", "attributes": { "name": "value" }, "contentClaimSection": "value", "contentClaimContainer": "value", "contentClaimIdentifier": "value", "contentClaimOffset": 0, "contentClaimFileSize": "value", "contentClaimFileSizeBytes": 0, "penalized": true } }

 Those details are exposed in the nifi api doc, just be sure to click into the entity.

avatar
Rising Star

@steven-matison Yes, I have the clusterNodeId, but not understand where to fit in this API. 

Can you please share the dummy API

avatar
Rising Star

Hi Everyone, the API would be :

 

GET https://<URL>/nifi-api/flowfile-queues/<id>/flowfiles/<flowfile-uuid>/content?clusterNodeId=<clusterNodeId>

 

You'll get the content of the FlowFile in the queue.