You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by "Harsch, Tim" <Ti...@thinkbiganalytics.com> on 2017/04/26 22:41:33 UTC

trouble making a reference to AWS bundle in a controller service

Hello,

I’ve been having some difficulty trying to add a reference to the AWSCredentialsProviderControllerService in my code.  Essentially I can add it as a property to my controller, all compiles fine and I can deploy and start Nifi.  But then when I go to add reference to it in the Controller Settings, it says:  "No controller service types found that are applicable for this property."


In case this was something strange in my code, I tried to revert to a more simple example.  If download the code discussed in the tutorial at http://www.nifi.rocks/developing-a-custom-apache-nifi-controller-service/


I add this to StandardPropertiesFileService:

    public static final PropertyDescriptor AWS_CRED_SERVICE = new PropertyDescriptor.Builder()

        .name("AWS Credentials Service")

        .description("The credentials provider service")

        .required(true)

        .identifiesControllerService(AWSCredentialsProviderControllerService.class)

        .build();


and of course add the property in the static initializer:

        props.add(AWS_CRED_SERVICE);


and add the only available dependencies for aws at sample-controller-service-api/pom.xml:


        <dependency>

            <groupId>org.apache.nifi</groupId>

            <artifactId>nifi-aws-nar</artifactId>

            <version>${nifi.version}</version>

            <type>nar</type>

        </dependency>


        <dependency>

            <groupId>org.apache.nifi</groupId>

            <artifactId>nifi-aws-processors</artifactId>

            <version>${nifi.version}</version>

        </dependency>


if I build with tests I get

 ControllerServiceProcessorTest.testOnTrigger:65 Processor has 1 validation failures:

'Properties Service' validated against 'propertiesServiceTest' is invalid because Controller Service is not valid: 'AWS Credentials Service' is invalid because AWS Credentials Service is required


If I build with skipTests and deploy I will get the "No controller service types found that are applicable for this property."


I notice that the AWS bundle doesn't split itself out into an API and implementation like the pattern discussed in the tutorial and the way it seems the other NIFI services are done.  Is that an issue?


Any help appreciated,


Thanks,

Tim

Re: trouble making a reference to AWS bundle in a controller service

Posted by "Harsch, Tim" <Ti...@thinkbiganalytics.com>.
That was the problem, thank you!  I’m still new to Nifi dev. :-)

From: James Wing <jv...@gmail.com>>
Reply-To: "users@nifi.apache.org<ma...@nifi.apache.org>" <us...@nifi.apache.org>>
Date: Wednesday, April 26, 2017 at 4:48 PM
To: "users@nifi.apache.org<ma...@nifi.apache.org>" <us...@nifi.apache.org>>
Subject: Re: trouble making a reference to AWS bundle in a controller service

Tim,

I think your PropertyDescriptor should reference the controller service interface type (AWSCredentialsProviderService.class), rather than a concrete implementing class type.  For example, in AbstractAWSCredentialsProviderProcessor:

    public static final PropertyDescriptor AWS_CREDENTIALS_PROVIDER_SERVICE = new PropertyDescriptor.Builder()
            .name("AWS Credentials Provider service")
            .description("The Controller Service that is used to obtain aws credentials provider")
            .required(false)
            .identifiesControllerService(AWSCredentialsProviderService.class)
            .build();

(see https://github.com/apache/nifi/blob/rel/nifi-1.1.2/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/AbstractAWSCredentialsProviderProcessor.java#L44)

Would that work any better?

Thanks,

James

On Wed, Apr 26, 2017 at 3:41 PM, Harsch, Tim <Ti...@thinkbiganalytics.com>> wrote:

Hello,

I’ve been having some difficulty trying to add a reference to the AWSCredentialsProviderControllerService in my code.  Essentially I can add it as a property to my controller, all compiles fine and I can deploy and start Nifi.  But then when I go to add reference to it in the Controller Settings, it says:  "No controller service types found that are applicable for this property."


In case this was something strange in my code, I tried to revert to a more simple example.  If download the code discussed in the tutorial at http://www.nifi.rocks/developing-a-custom-apache-nifi-controller-service/


I add this to StandardPropertiesFileService:

    public static final PropertyDescriptor AWS_CRED_SERVICE = new PropertyDescriptor.Builder()

        .name("AWS Credentials Service")

        .description("The credentials provider service")

        .required(true)

        .identifiesControllerService(AWSCredentialsProviderControllerService.class)

        .build();


and of course add the property in the static initializer:

        props.add(AWS_CRED_SERVICE);


and add the only available dependencies for aws at sample-controller-service-api/pom.xml:


        <dependency>

            <groupId>org.apache.nifi</groupId>

            <artifactId>nifi-aws-nar</artifactId>

            <version>${nifi.version}</version>

            <type>nar</type>

        </dependency>


        <dependency>

            <groupId>org.apache.nifi</groupId>

            <artifactId>nifi-aws-processors</artifactId>

            <version>${nifi.version}</version>

        </dependency>


if I build with tests I get

 ControllerServiceProcessorTest.testOnTrigger:65 Processor has 1 validation failures:

'Properties Service' validated against 'propertiesServiceTest' is invalid because Controller Service is not valid: 'AWS Credentials Service' is invalid because AWS Credentials Service is required


If I build with skipTests and deploy I will get the "No controller service types found that are applicable for this property."


I notice that the AWS bundle doesn't split itself out into an API and implementation like the pattern discussed in the tutorial and the way it seems the other NIFI services are done.  Is that an issue?


Any help appreciated,


Thanks,

Tim


Re: trouble making a reference to AWS bundle in a controller service

Posted by James Wing <jv...@gmail.com>.
Tim,

I think your PropertyDescriptor should reference the controller service
interface type (AWSCredentialsProviderService.class), rather than a
concrete implementing class type.  For example, in
AbstractAWSCredentialsProviderProcessor:

    public static final PropertyDescriptor AWS_CREDENTIALS_PROVIDER_SERVICE
= new PropertyDescriptor.Builder()
            .name("AWS Credentials Provider service")
            .description("The Controller Service that is used to obtain aws
credentials provider")
            .required(false)

.identifiesControllerService(AWSCredentialsProviderService.class)
            .build();

(see
https://github.com/apache/nifi/blob/rel/nifi-1.1.2/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/AbstractAWSCredentialsProviderProcessor.java#L44
)

Would that work any better?

Thanks,

James

On Wed, Apr 26, 2017 at 3:41 PM, Harsch, Tim <
Tim.Harsch@thinkbiganalytics.com> wrote:

> Hello,
>
> I’ve been having some difficulty trying to add a reference to the
> AWSCredentialsProviderControllerService in my code.  Essentially I can
> add it as a property to my controller, all compiles fine and I can deploy
> and start Nifi.  But then when I go to add reference to it in the
> Controller Settings, it says:  "No controller service types found that are
> applicable for this property."
>
>
> In case this was something strange in my code, I tried to revert to a more
> simple example.  If download the code discussed in the tutorial at
> http://www.nifi.rocks/developing-a-custom-apache-nifi-controller-service/
>
>
> I add this to StandardPropertiesFileService:
>
>     public static final PropertyDescriptor AWS_CRED_SERVICE = new
> PropertyDescriptor.Builder()
>
>         .name("AWS Credentials Service")
>
>         .description("The credentials provider service")
>
>         .required(true)
>
>         .identifiesControllerService(AWSCredentialsProviderControll
> erService.class)
>
>         .build();
>
>
> and of course add the property in the static initializer:
>
>         props.add(AWS_CRED_SERVICE);
>
>
> and add the only available dependencies for aws at
> sample-controller-service-api/pom.xml:
>
>
>         <dependency>
>
>             <groupId>org.apache.nifi</groupId>
>
>             <artifactId>nifi-aws-nar</artifactId>
>
>             <version>${nifi.version}</version>
>
>             <type>nar</type>
>
>         </dependency>
>
>
>         <dependency>
>
>             <groupId>org.apache.nifi</groupId>
>
>             <artifactId>nifi-aws-processors</artifactId>
>
>             <version>${nifi.version}</version>
>
>         </dependency>
>
>
> if I build with tests I get
>
>  ControllerServiceProcessorTest.testOnTrigger:65 Processor has 1
> validation failures:
>
> 'Properties Service' validated against 'propertiesServiceTest' is invalid
> because Controller Service is not valid: 'AWS Credentials Service' is
> invalid because AWS Credentials Service is required
>
>
> If I build with skipTests and deploy I will get the "No controller service
> types found that are applicable for this property."
>
>
> I notice that the AWS bundle doesn't split itself out into an API and
> implementation like the pattern discussed in the tutorial and the way it
> seems the other NIFI services are done.  Is that an issue?
>
>
> Any help appreciated,
>
>
> Thanks,
>
> Tim
>