You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Shashi Vishwakarma <sh...@gmail.com> on 2016/09/04 19:02:38 UTC

Controller Service Implementation Help

Hi

I need some help in my designing a controller service. I am developing a
controller service which returns a object of a class and then that object
can be referenced by multiple process.For Example

Employee emp = new Employee();
emp.setName("Jack");

return emp;

emp object will returned from controller service and will be used by custom
processor.

Let me know if my design is correct . I tried implementing this approach
but does not seems to be working. While referencing controller service
getting below value in processor..




My processor is showing some warning.


Any pointers on this?

Highly appreciate your help..!!!!

Thanks
Shashi
​

Re: Controller Service Implementation Help

Posted by Shashi Vishwakarma <sh...@gmail.com>.
Thanks a lot. It worked. There were two dependencies. I was missing nar
dependency in pom.

It was a great help.

On Tue, Sep 6, 2016 at 12:16 AM, Bryan Bende <bb...@gmail.com> wrote:

> Shashi,
>
> What does the structure of your controller service and processor projects
> look like? and the dependencies between them?
>
> I feel like this might be related to something not being correct in the
> way the projects depend on each other.
>
> Take a look at this page [1] which shows the recommended project
> structures, and specifically the section about linking a processor and
> controller service. There is also this GitHub example project [2] that
> shows a custom processor using a custom controller service.
>
> Thanks,
>
> Bryan
>
> [1] https://cwiki.apache.org/confluence/display/NIFI/Maven+
> Projects+for+Extensions
> [2] https://github.com/bbende/nifi-dependency-example
>
>
> On Mon, Sep 5, 2016 at 3:03 AM, Shashi Vishwakarma <
> shashi.vish123@gmail.com> wrote:
>
>> Hi Joe,
>>
>> Thanks for your reply. I have set .identifiesControllerService(MyService.class)
>> . Any other option that might have missed ? Is there any way to debug it?
>>
>> Thanks
>> Shashi
>>
>> On Mon, Sep 5, 2016 at 8:12 AM, Joe Witt <jo...@gmail.com> wrote:
>>
>>> Shashi
>>>
>>> You should not have to enter the controller service identifier. In your
>>> processors property descriptor have you used 'identifiesControllerService'
>>> set.  Such as in this example
>>>
>>>
>>>     static final PropertyDescriptor SSL_CONTEXT_SERVICE = new
>>> PropertyDescriptor.Builder()
>>>
>>>             .name("ssl.context.service")
>>>
>>>             .displayName("SSL Context Service")
>>>
>>>             .description("Specifies the SSL Context Service to use")
>>>
>>>             .required(false)
>>>
>>>             .identifiesControllerService(SSLContextService.class)
>>>
>>>             .build();
>>>
>>>
>>> Thanks
>>>
>>> Joe
>>>
>>> On Sep 4, 2016 3:02 PM, "Shashi Vishwakarma" <sh...@gmail.com>
>>> wrote:
>>>
>>>> Hi
>>>>
>>>> I need some help in my designing a controller service. I am developing
>>>> a controller service which returns a object of a class and then that object
>>>> can be referenced by multiple process.For Example
>>>>
>>>> Employee emp = new Employee();
>>>> emp.setName("Jack");
>>>>
>>>> return emp;
>>>>
>>>> emp object will returned from controller service and will be used by
>>>> custom processor.
>>>>
>>>> Let me know if my design is correct . I tried implementing this
>>>> approach but does not seems to be working. While referencing controller
>>>> service getting below value in processor..
>>>>
>>>>
>>>>
>>>>
>>>> My processor is showing some warning.
>>>>
>>>>
>>>> Any pointers on this?
>>>>
>>>> Highly appreciate your help..!!!!
>>>>
>>>> Thanks
>>>> Shashi
>>>> ​
>>>>
>>>>
>>
>

Re: Controller Service Implementation Help

Posted by Bryan Bende <bb...@gmail.com>.
Shashi,

What does the structure of your controller service and processor projects
look like? and the dependencies between them?

I feel like this might be related to something not being correct in the way
the projects depend on each other.

Take a look at this page [1] which shows the recommended project
structures, and specifically the section about linking a processor and
controller service. There is also this GitHub example project [2] that
shows a custom processor using a custom controller service.

Thanks,

Bryan

[1]
https://cwiki.apache.org/confluence/display/NIFI/Maven+Projects+for+Extensions
[2] https://github.com/bbende/nifi-dependency-example


On Mon, Sep 5, 2016 at 3:03 AM, Shashi Vishwakarma <shashi.vish123@gmail.com
> wrote:

> Hi Joe,
>
> Thanks for your reply. I have set .identifiesControllerService(MyService.class)
> . Any other option that might have missed ? Is there any way to debug it?
>
> Thanks
> Shashi
>
> On Mon, Sep 5, 2016 at 8:12 AM, Joe Witt <jo...@gmail.com> wrote:
>
>> Shashi
>>
>> You should not have to enter the controller service identifier. In your
>> processors property descriptor have you used 'identifiesControllerService'
>> set.  Such as in this example
>>
>>
>>     static final PropertyDescriptor SSL_CONTEXT_SERVICE = new
>> PropertyDescriptor.Builder()
>>
>>             .name("ssl.context.service")
>>
>>             .displayName("SSL Context Service")
>>
>>             .description("Specifies the SSL Context Service to use")
>>
>>             .required(false)
>>
>>             .identifiesControllerService(SSLContextService.class)
>>
>>             .build();
>>
>>
>> Thanks
>>
>> Joe
>>
>> On Sep 4, 2016 3:02 PM, "Shashi Vishwakarma" <sh...@gmail.com>
>> wrote:
>>
>>> Hi
>>>
>>> I need some help in my designing a controller service. I am developing a
>>> controller service which returns a object of a class and then that object
>>> can be referenced by multiple process.For Example
>>>
>>> Employee emp = new Employee();
>>> emp.setName("Jack");
>>>
>>> return emp;
>>>
>>> emp object will returned from controller service and will be used by
>>> custom processor.
>>>
>>> Let me know if my design is correct . I tried implementing this approach
>>> but does not seems to be working. While referencing controller service
>>> getting below value in processor..
>>>
>>>
>>>
>>>
>>> My processor is showing some warning.
>>>
>>>
>>> Any pointers on this?
>>>
>>> Highly appreciate your help..!!!!
>>>
>>> Thanks
>>> Shashi
>>> ​
>>>
>>>
>

Re: Controller Service Implementation Help

Posted by Shashi Vishwakarma <sh...@gmail.com>.
Hi Joe,

Thanks for your reply. I have
set .identifiesControllerService(MyService.class) . Any other option that
might have missed ? Is there any way to debug it?

Thanks
Shashi

On Mon, Sep 5, 2016 at 8:12 AM, Joe Witt <jo...@gmail.com> wrote:

> Shashi
>
> You should not have to enter the controller service identifier. In your
> processors property descriptor have you used 'identifiesControllerService'
> set.  Such as in this example
>
>
>     static final PropertyDescriptor SSL_CONTEXT_SERVICE = new
> PropertyDescriptor.Builder()
>
>             .name("ssl.context.service")
>
>             .displayName("SSL Context Service")
>
>             .description("Specifies the SSL Context Service to use")
>
>             .required(false)
>
>             .identifiesControllerService(SSLContextService.class)
>
>             .build();
>
>
> Thanks
>
> Joe
>
> On Sep 4, 2016 3:02 PM, "Shashi Vishwakarma" <sh...@gmail.com>
> wrote:
>
>> Hi
>>
>> I need some help in my designing a controller service. I am developing a
>> controller service which returns a object of a class and then that object
>> can be referenced by multiple process.For Example
>>
>> Employee emp = new Employee();
>> emp.setName("Jack");
>>
>> return emp;
>>
>> emp object will returned from controller service and will be used by
>> custom processor.
>>
>> Let me know if my design is correct . I tried implementing this approach
>> but does not seems to be working. While referencing controller service
>> getting below value in processor..
>>
>>
>>
>>
>> My processor is showing some warning.
>>
>>
>> Any pointers on this?
>>
>> Highly appreciate your help..!!!!
>>
>> Thanks
>> Shashi
>> ​
>>
>>

Re: Controller Service Implementation Help

Posted by Joe Witt <jo...@gmail.com>.
Shashi

You should not have to enter the controller service identifier. In your
processors property descriptor have you used 'identifiesControllerService'
set.  Such as in this example


    static final PropertyDescriptor SSL_CONTEXT_SERVICE = new
PropertyDescriptor.Builder()

            .name("ssl.context.service")

            .displayName("SSL Context Service")

            .description("Specifies the SSL Context Service to use")

            .required(false)

            .identifiesControllerService(SSLContextService.class)

            .build();


Thanks

Joe

On Sep 4, 2016 3:02 PM, "Shashi Vishwakarma" <sh...@gmail.com>
wrote:

> Hi
>
> I need some help in my designing a controller service. I am developing a
> controller service which returns a object of a class and then that object
> can be referenced by multiple process.For Example
>
> Employee emp = new Employee();
> emp.setName("Jack");
>
> return emp;
>
> emp object will returned from controller service and will be used by
> custom processor.
>
> Let me know if my design is correct . I tried implementing this approach
> but does not seems to be working. While referencing controller service
> getting below value in processor..
>
>
>
>
> My processor is showing some warning.
>
>
> Any pointers on this?
>
> Highly appreciate your help..!!!!
>
> Thanks
> Shashi
> ​
>
>