[
https://issues.apache.org/jira/browse/NIFI-5645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16645894#comment-16645894
]
ASF GitHub Bot commented on NIFI-5645:
--------------------------------------
Github user ijokarumawak commented on a diff in the pull request:
https://github.com/apache/nifi/pull/3037#discussion_r224302591
--- Diff:
nifi-nar-bundles/nifi-windows-event-log-bundle/nifi-windows-event-log-processors/src/main/java/org/apache/nifi/processors/windows/event/log/ConsumeWindowsEventLog.java
---
@@ -199,6 +230,8 @@ private String subscribe(ProcessContext context) throws
URISyntaxException {
subscriptionHandle = wEvtApi.EvtSubscribe(null, null, channel,
query, null, null,
evtSubscribeCallback,
WEvtApi.EvtSubscribeFlags.SUBSCRIBE_TO_FUTURE |
WEvtApi.EvtSubscribeFlags.EVT_SUBSCRIBE_STRICT);
+ lastActivityTimestamp = System.currentTimeMillis();
--- End diff --
I think if the client failed to subscribe, it keeps trying reconnecting at
subsequent onTrigger. So, updating lastActivityTimestamp in case of
subscription failure will not lead to premature I believe. But, I updated the
code anyway. It looks more correct in that way, thanks!
> Auto reconnect ConsumeWindowsEventLog if no log is consumed for configured
> time period
> --------------------------------------------------------------------------------------
>
> Key: NIFI-5645
> URL: https://issues.apache.org/jira/browse/NIFI-5645
> Project: Apache NiFi
> Issue Type: Improvement
> Components: Extensions
> Affects Versions: 1.0.0
> Reporter: Koji Kawamura
> Assignee: Koji Kawamura
> Priority: Major
>
> While ConsumeWindowsEventLog is running, if Windows Event Log service is
> restarted, or ERROR_EVT_QUERY_RESULT_STALE (15011) is returned, the processor
> keeps running, but will not receive further log events.
> Current work-around is restarting the processor manually.
> We could implement auto-reconnect logic like below, so that the processor can
> recover from such situation automatically.
> * Add a new processor property, ''Inactive duration to reconnect", e.g. "3
> mins"
> * At onTrigger, check how long has it passed since the last message was
> received. If it exceeds the configured duration, reset the consumer
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)