@Tags(value={"Retry","FlowFile"}) @CapabilityDescription(value="FlowFiles passed to this Processor have a \'Retry Attribute\' value checked against a configured \'Maximum Retries\' value. If the current attribute value is below the configured maximum, the FlowFile is passed to a retry relationship. The FlowFile may or may not be penalized in that condition. If the FlowFile\'s attribute value exceeds the configured maximum, the FlowFile will be passed to a \'retries_exceeded\' relationship. WARNING: If the incoming FlowFile has a non-numeric value in the configured \'Retry Attribute\' attribute, it will be reset to \'1\'. You may choose to fail the FlowFile instead of performing the reset. Additional dynamic properties can be defined for any attributes you wish to add to the FlowFiles transferred to \'retries_exceeded\'. These attributes support attribute expression language.") @InputRequirement(value=INPUT_REQUIRED) @SupportsBatching @SideEffectFree @ReadsAttribute(attribute="Retry Attribute", description="Will read the attribute or attribute expression language result as defined in \'Retry Attribute\'") @WritesAttribute(attribute="Retry Attribute",description="User defined retry attribute is updated with the current retry count") @WritesAttribute(attribute="Retry Attribute .uuid",description="User defined retry attribute with .uuid that determines what processor retried the FlowFile last") @DynamicProperty(name="Exceeded FlowFile Attribute Key", value="The value of the attribute added to the FlowFile", description="One or more dynamic properties can be used to add attributes to FlowFiles passed to the \'retries_exceeded\' relationship", expressionLanguageScope=FLOWFILE_ATTRIBUTES) public class RetryFlowFile extends AbstractProcessor
Modifier and Type | Field and Description |
---|---|
static PropertyDescriptor |
FAIL_ON_OVERWRITE |
static AllowableValue |
FAIL_ON_REUSE |
private Boolean |
failOnOverwrite |
static Relationship |
FAILURE |
private String |
lastRetriedBy |
static PropertyDescriptor |
MAXIMUM_RETRIES |
static PropertyDescriptor |
PENALIZE_RETRIED |
private Boolean |
penalizeRetried |
private List<PropertyDescriptor> |
properties |
private Set<Relationship> |
relationships |
static AllowableValue |
RESET_ON_REUSE |
static Relationship |
RETRIES_EXCEEDED |
static Relationship |
RETRY |
static PropertyDescriptor |
RETRY_ATTRIBUTE |
private String |
retryAttribute |
static PropertyDescriptor |
REUSE_MODE |
private String |
reuseMode |
static AllowableValue |
WARN_ON_REUSE |
Constructor and Description |
---|
RetryFlowFile() |
Modifier and Type | Method and Description |
---|---|
Set<Relationship> |
getRelationships() |
protected PropertyDescriptor |
getSupportedDynamicPropertyDescriptor(String propertyDescriptorName) |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
protected void |
init(ProcessorInitializationContext context) |
void |
onScheduled(ProcessContext context) |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
onTrigger
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, hashCode, onPropertyModified, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
private List<PropertyDescriptor> properties
private Set<Relationship> relationships
private String retryAttribute
private Boolean penalizeRetried
private Boolean failOnOverwrite
private String reuseMode
private String lastRetriedBy
public static final PropertyDescriptor RETRY_ATTRIBUTE
public static final PropertyDescriptor MAXIMUM_RETRIES
public static final PropertyDescriptor PENALIZE_RETRIED
public static final PropertyDescriptor FAIL_ON_OVERWRITE
public static final AllowableValue FAIL_ON_REUSE
public static final AllowableValue WARN_ON_REUSE
public static final AllowableValue RESET_ON_REUSE
public static final PropertyDescriptor REUSE_MODE
public static final Relationship RETRY
public static final Relationship RETRIES_EXCEEDED
public static final Relationship FAILURE
public Set<Relationship> getRelationships()
getRelationships
in interface Processor
getRelationships
in class AbstractSessionFactoryProcessor
protected void init(ProcessorInitializationContext context)
init
in class AbstractSessionFactoryProcessor
protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(String propertyDescriptorName)
getSupportedDynamicPropertyDescriptor
in class AbstractConfigurableComponent
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
@OnScheduled public void onScheduled(ProcessContext context)
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger
in class AbstractProcessor
ProcessException
Copyright © 2021 Apache NiFi Project. All rights reserved.