[
https://issues.apache.org/jira/browse/NIFI-736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14695438#comment-14695438
]
Mark Payne commented on NIFI-736:
---------------------------------
[~bende] sorry i never got around to looking at this. Very good to have this,
should make life easier for a lot of folks who are creating new controller
services! Some notes based on how I would expect to use the archetype:
* I would change the default nifi-version to 0.3.0-SNAPSHOT now. Currently the
patch has 0.1.0-incubating-SNAPSHOT
* Would change the folder name for "nifi-__artifactBaseName__-service-impl" to
"nifi-standard-__artifactBaseName__-service". We tend to use the 'java 7 naming
strategy' of StandardXYZ instead of XYZImpl. Also not sure that we should
append the "-service" because if I use this to create, for example, a new Avro
service, I would probably set the basename to "avro-service". So I would end up
with "nifi-avro-service-service-api" and "nifi-standard-avro-service-service".
* Similarly, would change name of the service from MyServiceImpl to
StandardMyService
* For implementation, would make a few tweaks:
- toString() isn't really needed because it's essentially the same
implementation as the abstract controller service provides
- would rename 'onConfigured' to 'onEnabled'
* For the unit test, I would remove the looking up of the service via the
getControllerServiceLookup() and then asserting that it is not null - i feel
like that's really testing the Mock Framework more than the service itself, and
isn't likely something we would want to test in a unit test for the service.
* The JUnit dependency in the implementation is explicitly setting the version,
overriding the parent's version. Should probably remove the version tag.
I like that you included a "TestProcessor" in there so that we can instantiate
the TestRunner... I do not like that we need that :( We need to be sure to
improve the framework so that creating a bogus Processor is not necessary to
unit test the controller service. I have already created a ticket for this,
NIFI-733. Just something we need to sort out.
Thanks!
-Mark
> Create a Maven Archetype for ControllerServices
> -----------------------------------------------
>
> Key: NIFI-736
> URL: https://issues.apache.org/jira/browse/NIFI-736
> Project: Apache NiFi
> Issue Type: Improvement
> Reporter: Bryan Bende
> Assignee: Bryan Bende
> Priority: Minor
> Fix For: 0.3.0
>
> Attachments: NIFI-736.patch
>
>
> It would be helpful for people building extensions to have a good starting
> point for building controller services, and it would also serve as a good
> example for learning the dependency relationship between nars.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)