我正在尝试学习如何创建自定义 NiFi 控制器服务。一开始,我想DBCPConnectionPool
通过简单地复制服务的原始源代码来模仿控制器DBCPConnectionPool
服务。为了实现同样的功能,我从“nifi- service -bundle-archetype”生成了一个 maven 原型,并得到了以下项目结构
但是,当我从 'nifi - processor -bundle -archetype 生成原型时,我得到了以下结构: -
我知道在处理器的情况下,我只需要在MyProceesor.java
当前nifi-ListDbTableDemo-processors
文件夹下编写我的代码,然后从中创建一个 nar 文件。但在控制器服务的情况下,我生成了 4 个文件夹。我可以看到两个java文件,即
StandardMyService.java
出现在nifi-DbcpServiceDemo
文件夹下MyService.java
出现在nifi-DbcpServiceDemo-api
文件夹下
现在,为什么在自定义控制器服务的情况下会生成两个java文件,而在自定义处理器的情况下只生成一个java文件。另外,由于我试图模仿DBCPConnectionPool
服务,我应该在其中的两个 java 文件中复制服务的原始源代码DBCPConnectionPool
。
请从头开始指导我,创建与服务等效的自定义服务需要遵循的步骤DBCPConnectionPool
。