[
https://issues.apache.org/jira/browse/NIFI-10303?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Vijaya Gorla updated NIFI-10303:
--------------------------------
Description:
When GetElasticsearch processor has an incoming connection, and the document id
is an expression, this results in expression evaluating to null when the
processor runs without a flow file.
This can be handled by short-circuiting the onTrigger method like many core
processors do
{code:java}
FlowFile input = null;
if (context.hasIncomingConnection()) {
input = session.get();
// If we have no FlowFile, and all incoming connections are
self-loops then we can continue on.
// However, if we have no FlowFile and we have connections coming
from other Processors, then
// we know that we should run only if we have a FlowFile.
if (input == null && context.hasNonLoopConnection()) {
return;
}
}
{code}
was:SearchElasticSearch stores cursor position in Local scope. However, it is
annotated to run on primary node only. This means when primary node changes it
will lose the cursor position and may start reading from the start.
> GetElasticsearch processor invokes elasticsearch GET api without an
> identifier when flow file is null
> -----------------------------------------------------------------------------------------------------
>
> Key: NIFI-10303
> URL: https://issues.apache.org/jira/browse/NIFI-10303
> Project: Apache NiFi
> Issue Type: Bug
> Affects Versions: 1.16.3
> Reporter: Vijaya Gorla
> Assignee: Chris Sampson
> Priority: Major
> Labels: elasticsearch
> Fix For: 1.19.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> When GetElasticsearch processor has an incoming connection, and the document
> id is an expression, this results in expression evaluating to null when the
> processor runs without a flow file.
> This can be handled by short-circuiting the onTrigger method like many core
> processors do
> {code:java}
> FlowFile input = null;
> if (context.hasIncomingConnection()) {
> input = session.get();
> // If we have no FlowFile, and all incoming connections are
> self-loops then we can continue on.
> // However, if we have no FlowFile and we have connections coming
> from other Processors, then
> // we know that we should run only if we have a FlowFile.
> if (input == null && context.hasNonLoopConnection()) {
> return;
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)