Getting current flow version - apache-nifi

I need to put the current flow version (as in the version number in NiFi Registry) on the properties of each flow file.
I know that I can use Expression Language to get system properties. Is there a property that contains the current version?

The version number is not something that is currently accessible from expression language. The only thing you could do right now would be to put an UpdateAttribute processor as the first processor inside the versioned process group, and set an attribute like "nifi.registry.version", but you'd have to keep the value up to date when you save the new version of the flow so that it is checked in to registry with next version.

Related

how to use property value in Directory Listing Data Source on Jmeter

I am setting a property value through JSR223 pre-procesor and want to use this property for source directory in Directory Listing Data Source but, not been succesful. Here's how i am trying to do it.Have i missed something?
setpropertyvalue
usepropertyindirectorylisting
The reason I want to do this is because I want to use files from different folder in each thread. I have named folders as ABC1, ABC2, ABC3 etc...and that is why i want to use thread number function for ABC${threadNum}. But, i am not able to achieve it.
It should work fine given you set the property before the directory listing config is initialized.
Take a look at JMeter Test Elements Execution Order
0. Configuration elements
1. Pre-Processors
2. Timers
3. Sampler
4. Post-Processors (unless SampleResult is null)
5. Assertions (unless SampleResult is null)
6. Listeners (unless SampleResult is null)
So as you can see Configuration Elements are being executed before anything else so you either need to
define your property in another configuration element which will be executed before the Directory Listing Config such as User Defined Variables
or move your code to setUp Thread Group
or provide the property value via -J command-line argument

What NOREPLACE means at netflix's nebula plugin?

I was using netflix's nebula. Looking here, I saw this line:
fileType [org.freecompany.redline.payload.Directive] - Default for types, e.g. CONFIG, DOC, NOREPLACE, LICENSE
I didn't find any doc about the actual meaning of this enum, but I've found the original code.
Now I want an actual description of this enum. I thought NOREPLACE is releated to being not allowed to replace the file. But I want to be sure and don't rely on assumptions.
I have only seen noreplace as an additional attribute on a config file, e.g. %config(noreplace). It means that if the user has edited the file, the installer should put its new version as filename.rpmnew; by default %config files are replaced with the user one put as filename.rpmold .

Spring boot: Override property value

Into my application-pre.properties file there's coded this property:
scheduler.url-backoffice=http://${BACKOFFICE_SERVICE}:8080
In order to fill it, I'm using -Dspring-boot.run.arguments=--spring.config.additional-location=scheduler-config.properties.
scheduler-config.properties:
BACKOFFICE_SERVICE=localhost
scheduler.url-backoffice=http://localhost:8081
I need to set BACKOFFICE_SERVICE property, otherwise spring doesn't start. So, it means that scheduler.url-backoffice comes to http://localhost:8080.
I 've added another line after that in order override its value.
My surprise is its value is not changed. I mean, scheduler.url-backoffice's value is http://localhost:8080 instead of http://localhost:8081.
I'm not able to change application-pre.properties content file.
Use multiple application properties files.
One can ship in the jar;
this contains the defaults.
For me, defaults translates to either the prod values,
if there is only one set of prod values,
or the developer local values (which should cause failures in production).
The second file contains the environment specific property values that
override the defaults.
You must change your startup values to achieve this.
Here is an example:
-Dspring-boot.run.arguments=--spring.config.additional-location=scheduler-config.properties,local-scheduler-config.properties
Edit: in response to "still not working".
It seems like you need much more than the "simple" approach I described above.
For that,
check out section 24. Externalized Configuration in the Spring Boot Reference Guide.
There are many techniques to override configuration values;
all are covered in the reference guide.

Is it possible to change ElasticSearch settings at runtime?

I want to set ‘http.max_content_length’ at runtime. Is it possible and how one can do it? And if one can do it at runtime can he also change publishing_port/host?
No. You can't. As per elasticsearch documentation, http.max_content_length is not dynamically updatable. For more details refer this link..
Changes we do in YAML file will get reflected in node after once you restart the node.

Embed parameter in another parameter name in teamcity

An example:
I am using autoinc feature in teamcity so whenever I change the version of my build I would like to change it only in one place.
%buildversion% is 5.0
so I would like to do the following:
%autoinc.buildname_%buildversion%%
to get %autoinc.buildname_5.0%.
Basically every time I change the version autoinc counter will be reseted.
Create the Paraemters
Create a Combined Paramter

Resources