Skip to main content

MonitorActivity

Description

Monitors the flow for activity and sends out an indicator when the flow has not had any data for some specified amount of time and again when the flow's activity is restored

Tags

active, activity, detection, flow, inactive, monitor

Properties

In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Threshold Duration *Threshold Duration5 minDetermines how much time must elapse before considering the flow to be inactive

Supports Expression Language, using Environment variables.
Continually Send Messages *Continually Send Messagesfalse
  • true
  • false
If true, will send inactivity indicator continually every Threshold Duration amount of time until activity is restored; if false, will send an indicator only when the flow first becomes inactive
Inactivity Message *Inactivity MessageLacking activity as of time: ${now():format('yyyy/MM/dd HH:mm:ss')}; flow has been inactive for ${inactivityDurationMillis:toNumber():divide(60000)} minutesThe message that will be the content of FlowFiles that are sent to the 'inactive' relationship

Supports Expression Language, using FlowFile attributes and Environment variables.
Activity Restored Message *Activity Restored MessageActivity restored at time: ${now():format('yyyy/MM/dd HH:mm:ss')} after being inactive for ${inactivityDurationMillis:toNumber():divide(60000)} minutesThe message that will be the content of FlowFiles that are sent to 'activity.restored' relationship

Supports Expression Language, using FlowFile attributes and Environment variables.
Wait for Activity *Wait for Activityfalse
  • true
  • false
When the processor gets started or restarted, if set to true, only send an inactive indicator if there had been activity beforehand. Otherwise send an inactive indicator even if there had not been activity beforehand.
Reset State on Restart *Reset State on Restarttrue
  • true
  • false
When the processor gets started or restarted, if set to true, the initial state will always be active. Otherwise, the last reported flow state will be preserved.
Copy Attributes *Copy Attributesfalse
  • true
  • false
If true, will copy all flow file attributes from the flow file that resumed activity to the newly created indicator flow file
Monitoring Scope *Monitoring Scopenode
  • node
  • cluster
Specify how to determine activeness of the flow. 'node' means that activeness is examined at individual node separately. It can be useful if DFM expects each node should receive flow files in a distributed manner. With 'cluster', it defines the flow is active while at least one node receives flow files actively. If NiFi is running as standalone mode, this should be set as 'node', if it's 'cluster', NiFi logs a warning message and act as 'node' scope.
Reporting Node *Reporting Nodeall
  • all
  • primary
Specify which node should send notification flow-files to inactive and activity.restored relationships. With 'all', every node in this cluster send notification flow-files. 'primary' means flow-files will be sent only from a primary node. If NiFi is running as standalone mode, this should be set as 'all', even if it's 'primary', NiFi act as 'all'.

This property is only considered if:
  • the property Monitoring Scope has a value of cluster

Dynamic Properties

This component does not support dynamic properties.

Relationships

NameDescription
activity.restoredThis relationship is used to transfer an Activity Restored indicator when FlowFiles are routing to 'success' following a period of inactivity
inactiveThis relationship is used to transfer an Inactivity indicator when no FlowFiles are routed to 'success' for Threshold Duration amount of time
successAll incoming FlowFiles are routed to success

Reads Attributes

This processor does not read attributes.

Writes Attributes

NameDescription
inactivityDurationMillisThe number of milliseconds that the inactivity has spanned
inactivityStartMillisThe time at which Inactivity began, in the form of milliseconds since Epoch

State Management

ScopeDescription
CLUSTER, LOCALMonitorActivity stores the last timestamp at each node as state, so that it can examine activity at cluster wide. If 'Copy Attribute' is set to true, then flow file attributes are also persisted. In local scope, it stores last known activity timestamp if the flow is inactive.

Restricted

This component is not restricted.

Input Requirement

This component requires an incoming relationship.

System Resource Considerations

This component does not specify system resource considerations.

See Also