0

I want to stop my invokehttp processor as soon as it's response fails ,is it possible to make it by another inovokehttp processor? I have read this solution: How to stop the single processor in nifi1.1.0 using rest api. I have already tried to use put request in my another invokehttp processor(which is connected to previous one with failure connection ) by this link http://localhost:8080/nifi-api/processors/ea5db028-015d-1000-5ad5-80fd006dda92 but it doesn't work(enter image description here) will i need to generate flowfile with realated code:

{
  "status": {
    "runStatus": "STOPPED"
  },
  "component": {
    "state": "STOPPED",
    "id": "9204b68d-0159-1000-7d8f-720592b2a2dd"
  },
  "id": "9204b68d-0159-1000-7d8f-720592b2a2dd",
  "revision": {
    "version": 10,
    "clientId": "ab010dd6-0159-1000-615b-f095502a7ceb"
  }
} 

or there is another way( actually i haven't understand how to use this code in flowfile)

Sagitarius
  • 348
  • 1
  • 11
  • 36
  • is it possible to use rest api if my service isn't rest? and i also want to kow what is this clientID and how can i find it – Sagitarius Aug 17 '17 at 08:17
  • open dev tools in your browser (`F12`), select the `Network` tab, stop the target `invokeHttp` processor, and check the parameters of the request that stopped your processor. then just repeat the same request and parameters in your nifi processor. – daggett Aug 17 '17 at 08:54
  • FYI: nifi-api documentation https://nifi.apache.org/docs/nifi-docs/rest-api/ – daggett Aug 17 '17 at 08:55
  • I have all needed parameter now included clentId( thank you for it) do you know how can i link json content posted below to my put request in invokehttp request should i invoke this 'service'(for stoping processor) internally in flowfile or is there any way i can send request body in invokehttp processor? – Sagitarius Aug 17 '17 at 11:40
  • read the manual. https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.3.0/org.apache.nifi.processors.standard.InvokeHTTP/index.html `FlowFile attributes are converted to HTTP headers and the FlowFile contents are included as the body of the request (if the HTTP Method is PUT, POST or PATCH)` Means you have to put your POST request content into flow file before `invokeHttp` – daggett Aug 17 '17 at 12:49
  • Ok , thank you .... – Sagitarius Aug 17 '17 at 13:32

0 Answers0