How recover Apache Nifi Project? - apache-nifi

based on this question: Recover NiFi project
and in this documentation: https://nifi.apache.org/docs/nifi-docs/html/user-guide.html
I am trying to recover my Apache Nifi project from conf/archive fields but I couldn't.
I am doing this steps:
I want to recover this file:
I copy it, change the name for flow.xml and paste it there:
My nifi.properties:
But I don't see the same processors that I saw in this project.
What am I doing wrong?

Related

How configs pick ENV value

We have a config folder structure in apps like this:
config
config.author.test
config.author.stage
These have config.runmode.env values
I wanted to know from where It picks the "env" value.
I thought it is coming from runmodes. but in the instances, stage or test is nowhere.
Can anyone please help me know where does the AEM configs picks the value or where do we define those env value. Is it in some OSGi configuration or from where.
If you are not using the AEM runtime for the AEM Cloud SDK, then the run modes can be set in other ways as well apart from the sling.properties file. So depending on how you are starting your AEM server check if the run modes have been specified using the other options.
If you are using the AEM runtime from the cloud SDK, then check if the Jar file is named as shown in the Quickstart jar startup modes.

How to create kubernetes configmap from properties file during maven build?

We have an old java application which has few properties files. We are doing a POC to deploy it in Kubernetes cluster using Helm chart. As of now, we manually creating configmap by copying the content from properties file. If any updates in properties file, as a result the same update should be done in configmap manually. So, Is there any solution available to create a configmap from the properties file during maven build?
Thanks in advance.
If you were using Spring Cloud Config in the past to fetch your properties and reload application during change of properties, there is an alternative provided by Spring for Kubernetes which allows fetching and reading the properties from your ConfigMap(s) directly and allows reload when the ConfigMap changes
Reference - https://cloud.spring.io/spring-cloud-static/spring-cloud-kubernetes/1.1.0.M3/reference/html/#kubernetes-propertysource-implementations
But looks like there is no solution available yet to generate ConfigMap(s) from property file(s) directly during a maven build.
It can be done by help of volume and volumeMounts.
You can get info from this

Where are the Configurations made in OSGi Console saved?

When we update any configuration for a component in the Configurations tab in the Apache Felix Web OSGi Console, where are these configuration settings saved? This is with respect to AEM 6.0 or above.
The manually saved configuration settings are stored in the the crx-quickstart/launchpad/config directory (in your AEM installation folder in the local file system) and, on top of that, as .config files in the Content Respository at /apps/system/config.
For example, if you're looking for the configuration of com.example.MyComponent, you can find it as a text file in crx-quickstart/launchpad/config/com/example/MyComponent.config (in the local file system) and at /apps/system/config/com.example.MyComponent.config inside your Content Repository.
The files at these two locations are updated when you change the settings manually in the OSGi console.
In AEM you can also store configuration in JCR nodes of the type sling:OsgiConfig. These will not be created or updated when you manually save the config but they offer a neat way of managing configuration as content.
When AEM looks for the configuration, the following order of resolution is used:
nodes under /apps/*/config, be it property files or JCR nodes with the node jcr:primaryType of sling:OsgiConfig
nodes with type sling:OsgiConfig under /libs/*/config, these are OOTB definitions for components that come with AEM
.config files from <aem-installation-directory>/crx-quickstart/launchpad/config/ on the local file system.
Depending on the OSGi configuration of Apache Sling JCR Installer, the sling:OsgiConfig nodes can be written back to when you manually change the config. There's also a number of settings affecting the lookup of said configurations so it's a good idea to familiarise oneself with this config.
Please check out the official documentation for more comprehensive information.
If you're trying to get a config stored in a sling:OsgiConfig node to work as expected and you're unsure if another config for the same service has been cached somewhere, here's a sequence of steps that has worked for me consistently in AEM 6.4:
Delete the sling:OsgiConfig node you just created
Go to the Felix console's configMgr, find the relevant service and Delete the configuration.
Recreate the sling:OsgiConfig node (I usually keep those in a CRX package that I can simply reinstall)
The configurations are stored by the felix configadmin bundle inside the felix bundle cache. Not sure where this cache is located in AEM. In Apache Karaf the configs in my case are in:
data/cache/bundle7/date/config
Where bundle id 7 is the id of the configadmin bundle.

Upload file from SonarQube dashboard

I am new to SonarQube and developing my own plugin. I am parsing an XML file in my plugin and I have hard coded it but now I want to upload that file from SonarQube dashboard. Is there any way to do this?
Assuming this file is used for user-supplied configuration use properties instead.
You can take a look at the Java plugin for plugin-level configuration, and at Widget Lab for widget-level config.

Updating KIE Execution Server container with updated rules file

This is where I am at:
I am using Drools 6.2 and calling drools engine remotely via KIE Execution Server running on jboss.
I used workbench to create my initial drl file and fact objects and then used Build & Deploy option of workbench to create and deploy the jar file. I then created the container using the jar file and got the end point that I am using to access the rule engine from my client application. At this point every thing is working fine and I am able to fire the rules remotely.
My requirement is to modify the rules file (.drl) outside the workbench, let's say in notepad and update the container with this new drl file. Is there an easy way to create the jar file programmatically that i can deploy to the central maven repository? I can then run the KIE scanner to look for the latest version of my jar file and automatically update my container. Or is there another recommended way to update the running container with an updated .drl file?
My client application is not in Java so I am not looking for an integrated solution where I can write java code to create the knowledge base and use kie builder to build the drl file.
Is there an easy way to create the jar file programmatically that i can deploy to the central maven repository?
2 options that I can think of, one "easy" and one not so much:
Option 1
Use Maven and the maven drools plugin (you don't have to write Java code, just create your maven project and run mvn package to get a jar. See here: https://docs.jboss.org/drools/release/6.0.1.Final/drools-docs/html/KIEChapter.html#KIEModuleIntroductionBuildingIntroductionSection
Option 2
A JAR file is simply a zip file with a specified structure. That means that you should be able to update your whatever.drl file, put it in the directory structure that the KIE server expects and deploy it.
For instance, create a directory structure like:
META-INF/kmodule.xml
com/site/project/drools/rules/myrule/SomeRule.drl
Zip those files into somefile.jar and deploy it.

Resources