Spring Cloud Dataflow app/stream default properties - spring-cloud-dataflow

I specified in the application.properties:
spring.cloud.config.uri=http://configserver:8888
but when I deploy a stream from the dashboard I can see in the logs
Fetching config from server at: http://localhost:8888
which means that it still tries to use the default settings.
Also any other properties like Kafka binder or zkNodes are not read from application.properties, but the default values are used, which makes the deployment to fail.
How can I override these properties for all the deployed app/streams?

The properties must be prefixed with spring.cloud.dataflow.applicationProperties.stream, like
spring.cloud.dataflow.applicationProperties.stream.spring.cloud.config.uri=http://configserver:8888
spring.cloud.dataflow.applicationProperties.stream.spring.cloud.stream.kafka.binder.brokers=kafka:9092
spring.cloud.dataflow.applicationProperties.stream.spring.cloud.stream.kafka.binder.zkNodes=zookeeper:2181

Related

Jmeter parametrize WebSocket variable

I doing test backend application (also Java and Node JS, communication: WebSocket in NodeJs part and http in Java part) in JMeter
I must parametrize url, to switch between development url, production and prepod
I did it by CSV file. I created folder CSV, in folder where I have Jmeter 5.0. I prepare 3 csv file
1.development are:
protocol, host
http, 10.219.227.66
2.prepod
protocol, host
https, prepod.myprepod.io
3.production
protocol, host
https, production.myproduction.io
I set this that:
CSV Data Set Config
Filename ${_P()/usr/local/Cellar/jmeter/5.0/libexec/CSV/development,development}.csv
variable Names ; protocol,host
WebSocket Open Connection
Server name or IP ${host}
Switch Controller
Switch Value ${protocol}
HTTP Request Default - server name or ip ${host}, protocol http ${protocol}
User defined variables
name value
protocol . ${_P(protocol,)}
host . ${_P(host,)}
Questions are:
What is wrong in my set this? what and how i must improve?
I project test save in desktop,but Jmeter 5.0 i have in others places in my computer - in users is folder jmeter 5 - if this could be a problem?
Does anyone know why it does not work for me and how to fix it?.
Everything is wrong
Given you defined protocol and host variables in the CSV file you don't need to declare them in the CSV Data Set Config, just leave the field blank
JMeter supports CSV files which have a header line defining the column names. To enable this, leave the "Variable Names" field empty. The correct delimiter must be provided.
Don't use full paths to CSV files as most probably it will make running tests on other machines, in distributed mode or in continuous integration server impossible.
so go for something like ${__P(environment,development)}.csv
Double check that protocol and host variables have expected values using Debug Sampler and View Results Tree listener combination
If you don't see them - check jmeter.log file for any suspicious entries, most probably JMeter cannot find .csv file and read variables from it. See How to Debug your Apache JMeter Script article for more details.
I fail to see any WebSocket URL schema (ws or wss) in your CSV files so I doubt your WebSocket Open Connection Server will ever be successfully executed.

Jmeter : Reading variable from csv and pass it into another varaible

I want to read a variable from CSV and use that value into another variable.
Example:
I have a variable as:
${url}: wwww.$(value_from_csv}.com
and secondary url ${url}/xyz
In my Jmeter script, ${value_from_csv} is not passed.
What I am missing?
Observed that CSV Dataset Config values are not passed (not available) to any of the Config Elements irrespective of the order of the components (Config Elements) in JMeter Test Plan (checked with User Defined Config & MongoDB Source Config), though passed to Samplers.
so, suggested the OP to define the value in jmeter.properties instead of a CSV file, so we can access user.host in MongoDB Source Config.
Steps:
Add user.host=address in jmeter.properties
Restart Jmeter
Add ${__P(user.host,)} in Server Address List field in MongoDB Source Config
Note: In case of running JMeter script from Jenkins, property will be picked by the script, from jmeter.properites file.
MongoDB Source Config is initialized before any JMeter Variables so the only way to make it dynamic is using JMeter Properties instead.
You can set a JMeter Property in 2 ways:
Define it in user.properties file like:
server.address.1=some.ip.or.hostname.1
server.address.2=some.ip.or.hostname.2
Pass the properties via -J command-line arguments like:
jmeter -Jserver.address.1=some.ip.or.hostname.1 -Jserver.address.2=some.ip.or.hostname.2 ....
See Apache JMeter Properties Customization Guide for more information on using JMeter Properties

Grails 3 (GORM) datasource properties not loading from Spring Cloud Config Server

I am trying to use Spring Cloud Config Server to externalize my Grails 3 (personnel) application configuration, but I cannot seem to set the dataSource properties.
Currently, I can load other properties (sample.message) into my Grails 3 (personnel) application and retrieve them using grailsApplication.config.sample.message without an issue. And hitting the REST endpoint on the Config Server (localhost:8888/personnel/master) is showing the configuration information I want, so I'm a bit confused.
I have tried each of the following in my personnel.properties file in my Git repo:
datasource.user=example
datasource.password=example
grails.datasource.user=example
grails.datasource.password=example
spring.datasource.user=example
spring.datasource.password=example
But none of them work. I continue to see error messages saying sa#localhost (using password: no) suggesting that the datasource properties, in particular, are not working.
I know it is possible with spring-boot-starter-data-jpa, so I'm wondering:
Is it possible with GORM?
If so, do I need to manually create the datasource bean?
What property names do I use datasource.user, grails.datasource.user, spring.datasource.user, etc?
After Shashank's edit, I realized that it was an issue with my property settings. datasource should have been dataSource and user should be username. Once those corrections were made, the application (personnel) worked perfectly. So,
Yes it is possible.
No, you don't need to create the bean manually
Property names are:
personnel.properties
dataSource.username=example
dataSource.password=example
dataSource.url=jdbc:mysql://localhost:3306/personnel

In DropWizard, can we have a default YAML configuration file?

We are using DropWizard v0.8.1 and we're wondering if we can have a YAML files with default values that will then get overridden by the specific environment file (such as dev.xml).
Spring boot works this way, where the application.yml file act as a template for default values and then application-dev.yml will override duplicate properties.
We don't want to duplicate all the repetitive properties and only want to update in one file the defaults.
You can write your own ConfigurationProvider that combines 2 InputStreams and use yaml merge directives
You can use a configuration management tool, such as Ansible, to manage your configurations files.
Set up a template .yml file, and substitute the variables per environment as needed.

Properties in the database

I'd like to store properties in a database tables and have defaults for those properties set in Config.groovy. For example, I want to put a default email address into Config.groovy:
app.send.report.to = 'me#example.com'
and then be able to override this in a database table (key, value columns...).
Is there a plugin (or functionality inside grails) to do this?
There is Dynamic Config Plugin.
It stores config property in ConfigProperty domain and merges properties from Config.groovy and from database using:
grailsApplication.config.merge(configObject)
You may want to look at the plugin source code. If plugin does not work for you, you can implement something similar to this.
This approach is useful when you have UI for editing config properties.
Grails does not have functionality that I'm aware of to override configuration values from a database, but it shouldn't be that difficult to do. In your Config.groovy you could put the defaults, and then as part of your bootstrap process, you could generate a temporary config file that has the values from the database (a simple query and iteration over the results could be used to generate that temp file). Include that temp file as one of your grails config locations, and it will override any values that are in the Config.groovy
If your goal is to have a shared configuration file that is used by multiple grails apps, you might also look into using something like Zookeeper to manage the shared configuration, but that may be a bit overkill for a single config file.
Not quite what you're asking for, but depending on what you want to achieve the External Configuration Reload plugin might be of use. It helps you to override default properties (in runtime), but not by using the DB.

Resources