[
https://issues.apache.org/jira/browse/NIFI-4816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16354314#comment-16354314
]
ASF GitHub Bot commented on NIFI-4816:
--------------------------------------
Github user markap14 commented on the issue:
https://github.com/apache/nifi/pull/2452
@mattyb149 thanks for the update. This is definitely something that I think
we should have added at the start. I'm curious about why the update to all of
the reporting tasks, though. None of them make use of the name, as far as I can
tell, so why both storing it off? Moreover, if we do want to store it off, then
why not just have the setName() method have an @OnScheduled annotation and take
in the ConfigurationContext. Then the abstract impl will automatically have the
name set. It would not necessarily be available if being called from other
@OnScheduled methods, but I think that's okay as long as it is documented - in
such a case, you should call the method on the ReportingContext itself.
> Changes to ReportingTask name are not available to the ReportingTask
> --------------------------------------------------------------------
>
> Key: NIFI-4816
> URL: https://issues.apache.org/jira/browse/NIFI-4816
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework, Extensions
> Reporter: Matt Burgess
> Assignee: Matt Burgess
> Priority: Major
>
> The Reporting Task name is only set on the ReportingTask itself during
> initialize(), which is only called the first time the ReportingTask is
> instantiated. This means if you change the name of the ReportingTask and
> restart it, The ReportingTask has its original name and the current name is
> inaccessible via the ConfigurationContext it is passed later. If you restart
> NiFi, the new name is set and stays that way.
> Rather than calling initialize() more than once, it is proposed to make the
> current name (and any other appropriate properties) available perhaps via
> ConfigurationContext which is passed to methods annotated with OnScheduled.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)