nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brandon DeVries <...@jhu.edu>
Subject Re: Help required with my custom controller service
Date Mon, 10 Aug 2015 20:25:58 GMT
Bryan and Mark,

I suspect that will do it.  I'll check tomorrow.

Brandon

On Mon, Aug 10, 2015, 4:23 PM Bryan Bende <bbende@gmail.com> wrote:

> Not sure if this is helpful, but there is a section about adding
> dependencies on controller services at the end of this wiki page:
>
>
> https://cwiki.apache.org/confluence/display/NIFI/Maven+Projects+for+Custom+Processors
>
>
> On Monday, August 10, 2015, Mark Payne <markap14@hotmail.com> wrote:
>
> > Brandon,
> >
> > I've seen this occur when I forgot to add a dependency on the
> > ssl-context-service-api-nar in my NAR's pom.
> >
> > You should have something like:
> > <dependency>
> >   <groupId>org.apache.nifi</groupId>
> >   <artifactId>ssl-context-service-api</artifactId>
> >   <version>0.3.0-SNAPSHOT</version>
> >   <type>nar</type>
> > </dependency>
> >
> > Is that by chance the issue, or is there something else going on?
> >
> > Thanks
> > -Mark
> >
> > ----------------------------------------
> > > From: brd@jhu.edu <javascript:;>
> > > Date: Mon, 10 Aug 2015 19:13:50 +0000
> > > Subject: Re: Help required with my custom controller service
> > > To: dev@nifi.apache.org <javascript:;>
> > >
> > > All,
> > >
> > > Was this ever solved / explained? I'm having a similar issue. If
> there's
> > > a simple answer that I'm missing that would be great... otherwise I
> might
> > > post an example set of NARs somewhere tomorrow. Probably the simplest
> > > question first is, if I want to create a custom processor that uses a
> > > SSLContextService, what dependencies do I need to add where (assuming
> > we're
> > > using the processor NAR archetype)? I've created an example that
> > compiles,
> > > loads in NiFi, and can be dropped on the graph. However, it can not be
> > > configured to use any currently existing SSLContextService, and any
> that
> > > are created have the same UUID issue described by David. Thoughts?
> > >
> > > Brandon
> > >
> > >
> > >
> > > On Tue, Jul 28, 2015 at 10:50 AM Mark Payne <markap14@hotmail.com
> > <javascript:;>> wrote:
> > >
> > >> Dave,
> > >>
> > >> In addition to the points that Aldrin brought up, are your
> CacheService
> > >> interface
> > >> and StandardCacheService classes in the same NAR?
> > >>
> > >> If they are not in the same NAR, does your NAR for
> StandardCacheService
> > >> have a Maven dependency
> > >> on the NAR that houses CacheService?
> > >>
> > >> Thanks
> > >> -Mark
> > >>
> > >> ----------------------------------------
> > >>> From: aldrinpiri@gmail.com <javascript:;>
> > >>> Date: Mon, 27 Jul 2015 23:26:58 -0400
> > >>> Subject: Re: Help required with my custom controller service
> > >>> To: dev@nifi.apache.org <javascript:;>; davidrsmith@btinternet.com
> > <javascript:;>
> > >>>
> > >>> Dave,
> > >>>
> > >>> Some quick notes as I work through your setup.
> > >>>
> > >>> Did you create an entry in your
> > >>> NAR's org.apache.nifi.controller.ControllerService file? This would
> be
> > in
> > >>> src/main/resources/META-INF/services directory of your project. It
> > seems
> > >>> like this isn't likely the case, but a point that can sometimes get
> > >>> overlooked.
> > >>>
> > >>> Your accessing of the service property in your processor looks good.
> > >>>
> > >>> Did you accidentally override
> > AbstractControllerService#getIdentifier()?
> > >>> It seems like this could lead to the error you are seeing, but it is
> > hard
> > >>> to be sure.
> > >>>
> > >>> If you are able to share more code with us, we can provide some more
> > >>> pointed assistance. Have you managed to get your processor and
> > controller
> > >>> service running within the test framework [1]? If not, I would
> suggest
> > >>> doing so to cut down on iterations in debugging your problems as well
> > as
> > >>> providing a means for you to easily step through the code.
> > >>>
> > >>> [1]
> > >>
> http://nifi.apache.org/docs/nifi-docs/html/developer-guide.html#testing
> > >>>
> > >>> On Sun, Jul 26, 2015 at 4:45 PM, DAVID SMITH <
> > davidrsmith@btinternet.com <javascript:;>
> > >>>
> > >>> wrote:
> > >>>
> > >>>> Hi
> > >>>> I have been trying to write a simple Cache Controller Service that
> > uses
> > >> a
> > >>>> Map to hold <String, String> key/value pairs. I am using
> > >>>> nifi-0.1.0-incubating. I have created an Interface called
> CacheService
> > >>>> which extends ControllerService.public interface CacheService
> extends
> > >>>> ControllerService {
> > >>>>
> > >>>> I have created an implementation called StandardCacheService which
> is
> > as
> > >>>> follows:
> > >>>> public class StandardCacheService extends AbstractControllerService
> > >>>> implements CacheService {
> > >>>> I have compiled the StandardCacheService and created a nar which
I
> > have
> > >>>> then put into my NiFi lib directory, my StandardCacheService
> > Controller
> > >>>> Service appears in the Controller services tab of the NiFi Flow
> > Settings
> > >>>> panel, I can edit it and enable it. Also there are no abnormal
log
> > >> messages.
> > >>>> However, when I try to configure the CacheService in my test
> > Processor,
> > >>>> again I get no errors but when I cannot see my StandardCacheService.
> > My
> > >>>> processor has the following snippets to implement the Cache
> > >>>> Service/Controller:
> > >>>> public static final PropertyDescriptor CACHE_SERVICE = new
> > >>>> PropertyDescriptor.Builder()
> > >>>> .name("Cache Service")
> > >>>> .description("The Controller Service to use in order to obtain
a
> > >>>> Cache Service")
> > >>>> .required(false)
> > >>>> .identifiesControllerService(CacheService.class)
> > >>>> .build();
> > >>>>
> > >>>> final CacheService cache =
> > >>>>
> > >>
> >
> context.getProperty(CACHE_SERVICE).asControllerService(CacheService.class);
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>> When configuring the processor, the 'Cache Service' drop down
> doesn't
> > >> show
> > >>>> a populated list showing my StandardCacheService, but it does allow
> me
> > >> to
> > >>>> create a new service, the resulting panel allows me to then select
> > >>>> StandardCacheService. When I select 'create' I get a UUID value
in
> the
> > >>>> Value property of the Configure Processor panel. When I then apply
> > this
> > >>>> the processor shows a yellow triangle, when I hover over it I get
> the
> > >>>> following message:
> > >>>> 'Cache Service validated against <UUID> is invalid because
Invalid
> > >>>> Controller service <UUID> is not a valid Controller service
> Identifier
> > >> or
> > >>>> does not reference the correct type of Controller service.'
> > >>>> Can you help please
> > >>>> Many thanksDave
> > >>>>
> > >>>>
> > >>
> >
>
>
>
> --
> Sent from Gmail Mobile
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message