I'm creating a NiFi flow using the NiFi api available at https://nifi.apache.org/docs/nifi-docs/components/nifi-docs/rest-api/index.html .
I'm watching the browser's requests while creating a flow using the UI and I'm noticing each request contains a "revision" component with a "version" attribute.
What is the purpose of it and how do I know what version to send with my requests?
Thank you in advance!
The revision concept is used to implement an optimistic locking strategy when updating a component. For example, imagine two users both open the configuration of a processor and start making changes, user1 submits their changes, then user2 submits their changes. The changes made by user2 are no longer accurate as they were based on the state of the processor before user1 made changes. The way this is enforced is that after user1 makes changes, the version of the revision would be incremented on the server, and user2 will submit their changes with previous version and the server will know it is not up to date and reject it.
So long story short, you should be retrieving the component to obtain the current revision/version and sending that back with your changes. If no one else changed the component, then the versions will match and your update succeeds.