[
https://issues.apache.org/jira/browse/MINIFICPP-2006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Martin Zink resolved MINIFICPP-2006.
------------------------------------
Resolution: Fixed
With MINIFICPP-2018 merged you now can save states with the StateManager in
Python (and in Lua) processors. (even persistently between runs if you use for
example RocksDbStateStorage). You can see examples here:
https://github.com/apache/nifi-minifi-cpp/commit/004cede3e9040a08633c4900dbc11d2a12d53487#diff-ea53bc90167b36609ea8cb4fc2c9631c370f57479c66fd6c93a847932f2fbe39R265-R290
Or if you dont need persistence between runs you could use the
NativePythonProcessors e.g.
https://github.com/apache/nifi-minifi-cpp/blob/main/extensions/python/tests/test_python_scripts/stateful_processor.py
> saving state for python processors
> ----------------------------------
>
> Key: MINIFICPP-2006
> URL: https://issues.apache.org/jira/browse/MINIFICPP-2006
> Project: Apache NiFi MiNiFi C++
> Issue Type: New Feature
> Affects Versions: 0.12.0
> Reporter: Kondakov Artem
> Priority: Major
>
> Hello.
> I'm using InvokeHTTP to periodically fetch data from the server.
> The data is received and in the response I can get the ID of the last
> returned record.
> Then through I save the data in a DB.
> How can I save the value of the identifier of this last record in order to
> form a new request to the server based on it.
> I know that the QueryDatabaseTable processor can save the ID of the last
> record received from the database. How to make an analogue of the same
> functionality?
> Is it possible to save the state of the data for the python processor in the
> same way as for QueryDatabaseTable?
> Is it possible to get the state of one processor from another (for example,
> in one Python processor I save the state of the id of the last record), and
> in another I take the identifier from the state of the first one, and form a
> new request?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)