Member since
11-09-2022
2
Posts
1
Kudos Received
0
Solutions
12-25-2024
03:57 PM
1 Kudo
@Roomka Looks an old post all the same I will try to answer and I hope its still relevant to others too The challenges you're facing with Apache NiFi's development life cycle stem from its design, which does not fully separate code/logic and environment-specific configurations. To address this and create a robust process for porting flows from dev to QA to prod, consider the following solutions: 1. Use Parameter Contexts for Configuration Management NiFi supports Parameter Contexts, which can be used to externalize environment-specific configurations. This allows you to separate logic from environment-specific details. Steps: Define Parameter Contexts for each environment (e.g., DevContext, QAContext, ProdContext). Externalize configurations like: Number of threads Cron schedules Database connection strings API endpoints When deploying to a new environment: Import the flow without the environment-specific Parameter Contexts. Assign the appropriate Parameter Context for that environment. 2. Use NiFi Registry for Flow Versioning and Promotion The NiFi Registry provides a way to version control your flows and manage deployments across environments. Steps: Set up NiFi Registry and connect your NiFi instances to it. Use the Registry to version your flows. Promote flows from dev to QA to prod by exporting/importing them through the Registry. In each environment, override parameters using the appropriate Parameter Context. 3. Handle Env.-Specific Differences with External Configuration Management If Parameter Contexts are insufficient, consider externalizing configurations entirely using tools like Consul, AWS Parameter Store, or environment variables. Steps: Store all environment-specific configurations in an external tool. Use a custom script or a NiFi processor to fetch configurations dynamically at runtime. This ensures the flow logic remains the same across environments, and only the external configurations vary. 4. Adopt Best Practices for Flow Design To reduce the impact of embedded environment-specific details, follow these design principles: Avoid hardcoding resource-intensive configurations like thread counts or cron schedules into the flow. Use NiFi Variables or Parameters wherever possible to make configurations flexible. Split flows into smaller, reusable components to reduce complexity and improve maintainability. 5. Use Deployment Automation Automate the deployment process to ensure consistency and reduce manual errors. Use tools like Ansible, Terraform, or Jenkins to automate flow deployment. Include steps to set up Parameter Contexts or fetch external configurations as part of the deployment pipeline. 6. Mitigating the 12-Factor Principles Concern While NiFi isn't designed to fully adhere to 12-factor principles, you can adapt your processes to bridge this gap: Codebase: Manage flow versions centrally using NiFi Registry. Config: Externalize environment-specific configurations using Parameter Contexts or external configuration management tools. Build, Release, Run: Standardize your flows and deployment pipeline across environments. Disposability: Test flows rigorously in QA to ensure they can handle unexpected failures gracefully. Hope these points give you a better picture and possibly an answer Happy Haddoping
... View more
11-09-2022
03:42 AM
Hi, I am trying to create a custom apache nifi processor using maven archetype: GroupId: org.apache.nifi ArtifactId: nifi-processor-bundle-archetype Version: 1.18.0 If I add in my processor maven dependency <dependency> <groupId>org.json</groupId> <artifactId>json</artifactId> <version>20220924</version> <scope>compile</scope> </dependency> and then try to run maven install I receive the following error: [ERROR] Rule 3: org.apache.maven.plugins.enforcer.BannedDependencies failed with message: Found Banned Dependency: org.json:json:jar:20220924 Use 'mvn dependency:tree' to locate the source of the banned dependencies. Looking at parent nifi dependencies I am seeing this section in nifi.1.18.0 pom.xml file <bannedDependencies> <excludes> <!-- Cat-X Deps --> <exclude>org.json:json:*:*:compile</exclude> ... Why org.json dependency is explicitly banned? If it's expected how a custom processor can use classes and functionalities from org.json package such as JSONObject ? Thank you in advance, Roman
... View more
Labels:
- Labels:
-
Apache NiFi