You can get the current property values of a controller service from the 
processor by using the ProcessContext object. For example, in GetHTTP [1], in 
the @OnScheduled method, you could do:



I forget if context.getProperty() will give the controller service properties 
as well as the processor properties. If it doesn’t, you can cast the retrieved 
ControllerService into AbstractControllerService or the concrete class and 
access available properties directly from the encapsulated ConfigurationContext.


Andy LoPresto
PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69

> On Aug 9, 2017, at 6:57 PM, 尹文才 <> wrote:
> Thanks Koji, I checked the link you provided and I think getting a
> DataSource is no different than getting the DBCP service(they could just
> get the connection). Actually I was trying to get the configured driver
> class to check the database type.
> Regards,
> Ben
> 2017-08-10 9:29 GMT+08:00 Koji Kawamura <>:
>> Hi Ben,
>> I'm not aware of ways to obtain configurations of a controller from a
>> processor. Those should be encapsulated inside a controller service.
>> If you'd like to create DataSource instance instead of just obtaining
>> a connection, this discussion might be helpful:
>> Although I would not recommend, if you really need to obtain all
>> configurations, you can do so by calling NiFi REST API from your
>> processor.
>> Thanks,
>> Koji
>> On Thu, Aug 10, 2017 at 10:09 AM, 尹文才 <> wrote:
>>> Hi guys, I have a customized processor with a DBCP controller service as
>> a
>>> property. I could get the DBCP controller service in my code, but does
>>> anyone know how to obtain all the configurations of the DBCP controller
>>> service in java code(e.g. Database Connection URL, Database Driver
>>> Location, etc) Thanks.
>>> Regards,
>>> Ben

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to