I have developed a custom Nifi processor as well as two custom Nifi services. I need to be able to use both services within the single processor. I created test cases to verify that everything works programmatically, but when I attempt to attach both services to the processor within the Nifi UI I get the following error:
'Config service' validated against 'f00b2....' is invalid because Invalid Controller Service f00b2... is not a valid Controller Service Identifier or does not reference the correct type of Controller Service
Are you allowed to have more than one service attached to a single processor? Any other reason why I would be getting this error? I should note that both services work when they are the only service attached to the processor. The error only occurs when both are attached.
How are you configuring your processor to use multiple services? Do you have a separate property for each controller service to which it can be assigned? In the property descriptor for each property, has the proper type been passed in to the identifiesControllerService method on the descriptor?
Looking at the code for the PostHTTP processor:
public static final PropertyDescriptor SSL_CONTEXT_SERVICE = new PropertyDescriptor.Builder() .name("SSL Context Service") .description("The Controller Service to use in order to obtain an SSL Context") .required(false) .identifiesControllerService(SSLContextService.class) .build();
If a second property descriptor was added to allow another type of controller service (let's say a custom serialization controller service) to be used in PostHTTP, the type of the service would have to be specified.
public static final PropertyDescriptor CUSTOM_SERIALIZATION_SERVICE = new PropertyDescriptor.Builder() .name("Serialization Service") .description("The Serialization Service to use to serialize data") .required(false) .identifiesControllerService(CustomSerializationService.class) .build();
In the NiFi UI, once SSL Context Service and Custom Serialization Service instances have been created in the appropriate Process Group(s), they can be assigned to the properties of the processor.
Yea this is exactly what I am doing except I am using two custom services. The problem happens when I use two services that I have developed.
Is it possible to provide your flow and/or code? Does the user configuring the processors have read permissions on the controller services?
How are you specifying the controller service in the property? Are you creating the controller service from a Processor Group's Configuration page and the going into the processor's configuration and selecting it from the dropdown, or are you clicking on "Create new service" in the dropdown?