Oleg Zhurakousky created NIFI-2372:
--------------------------------------
Summary: Allow ProcessSession to be passed to operations annotated
with @OnUnscsheduled
Key: NIFI-2372
URL: https://issues.apache.org/jira/browse/NIFI-2372
Project: Apache NiFi
Issue Type: Improvement
Components: Core Framework
Reporter: Oleg Zhurakousky
Assignee: Oleg Zhurakousky
Priority: Minor
Fix For: 1.1.0
With adoption of NiFi there are more and more cases where Processors that
source their data from the external systems (e.g., Email, JMS, MQTT etc) may
need to hold an internal queue of data to be sent as content in individual
FlowFiles. This implies somewhat of a persistent *state* between subsequent
invocation of the _onTriggered(..)_ operation. This creates a problem for the
processors that still have data in the internal data queue while being stopped.
While stoping of the processor is not a real issue (since the instance of the
processor is preserved), the subsequent stopping of NiFi that may follow is.
One of the way of dealing with it is to drain the internal data queue before
shitting down processor, but that requires access to ProcessSession which is
not currently supported by NiFi to operations annotated with _@OnUnscheduled_,
resulting in variety of workarounds (e.g., have ProcessSession as instance
variable of the Processor instance, etc.).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)