Skip to content

Configuration

Serhat Can edited this page Jun 13, 2017 · 3 revisions

There are two applications that we will need to provide an application.properties file to configure.

General information about usage of application.properties file with Spring

To run the application in "dev" mode, there is already an application-dev.properties file in the project. You can modify it as you wish. Another option is to copy the file as "application.properties" to the same resources folder. Note that this is by git as we don't want to have a global configuration file in the application.

If you want to use the jar file provided in the release part, as there is no application.properties file included in the jar file itself, you will need to put "application.properties" file to the same folder that your jar file is.

For more information about this, you can visit Running using Maven page.

Scenario generator (server)

For the scenario generator's main application (called server), as currently, we did not need to have an auto-discovery mechanism, we will need to tell the applications which agents exist.

agents.easyTravel.name=easyTravel
agents.easyTravel.description=EasyTravel helps you travel the world
agents.easyTravel.url=https://127.0.01:9008

agents.badges.name=myApp
agents.badges.description=My beautiful application
agents.badges.url=http://localhost:9010

For each agent, you will need to have a unique key under agents key. Name also should be unique. Url is used to access to the agents, so it has to be a valid one.

Scenario generator agent

As an agent can run one application at the same time, and there can more than one supported application in the agent itself, we will need to tell the application to run for which application. Let's say agent will work with the easyTravel application. (Supported by default)

scenario.application=easyTravel

This config is to tell the application to start for which application. Related service will be registered accordingly. You can see ScenarioServiceConfig.java file to understand more about this.


easyTravel.apiUrl=http://localhost:8091

In easyTravel's case, we will need some additional configs. So, we have EasyTravelConfigurationProperties.java file to access easyTravel related configs. If you need something like this for your own application, you can create one and use it in the same way.


easyTravel.availableScenarios[0].name=CPULoad
easyTravel.availableScenarios[0].minTime=20
easyTravel.availableScenarios[0].maxTime=200

easyTravel.availableScenarios[1].name=CrashCouchDB

Scenarios need some basic configurations. In easyTravel's case, we decided to restrict the available error patterns so we have the availableScenarios config. This config is an array and you can define as many error patterns as you want. You need to be careful about giving the exact name of the error pattern in easyTravel to the name field.

We also have a config that specifies the minimum and maximum time allowed for a scenario. In easyTravel's case, we decide this through config (may be different for other apps). If you don't specify min and max time for a scenario, it is set as min=60 and max=180 seconds by default.

Clone this wiki locally