Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Usage
NB: JRE 17 must be used to run the program.
## CLI
The command line interface is internationalized: messages are available in French or English.
```
AgroMetInfo-SEASON-handler [-hV] [--verbose] --config=<PATH>
Description:
Log directory can be configured using the environment variable AGROMETINFO_LOGS. Default value: logs/.
--config=<PATH> Configuration file (.properties file)
-h, --help Show this help message and exit.
-V, --version Print version information and exit.
--verbose Verbose mode
Exit codes:
0 Successful program execution. (notice leading space ' ')
64 Usage error: user input for the command was incorrect.
```
Default usage is:
```sh
$JAVA_HOME/bin/java -jar target/season-handler-0.1-SNAPSHOT.jar --config src/test/resources/config-good-with-stages.properties
```
## Configuration file
The configuration file use the [`.properties`](https://fr.wikipedia.org/wiki/.properties#Format) format.
A valid example is available in the test sources at `src/test/resources/config-good-with-stages.properties`:
```properties
## AgroMetInfo-SEASON-handler configuration
simulation.path.0 = src/test/resources/simulation-good-with-stages.properties
## JMS configuration
# Set the InitialContextFactory class to use
java.naming.factory.initial = org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
# Use the following property to configure the default connector
# ActiveMQ
java.naming.provider.url = tcp://localhost:61616?reconnectAttempts=-1
queue.newSafranDataQueueLookup = agrometinfo-new-safran-data
queue.treatmentQueueLookup = treatment
topic.simulationDoneTopicLookup = simulation-done
## Same as in running SEASON-cli.
season.results.table.owner = season
season.results.table.reader = season-read
## Persistence unit "simulation"
simulation.javax.persistence.jdbc.driver = org.postgresql.Driver
simulation.javax.persistence.jdbc.url = jdbc:postgresql://localhost/season?ApplicationName=season-cli-simulation-dev
simulation.javax.persistence.jdbc.user = season
simulation.javax.persistence.jdbc.password = season
simulation.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
simulation.hibernate.show_sql = false
# Configuring Connection Pool
simulation.hibernate.connection.provider_class=org.hibernate.hikaricp.internal.HikariCPConnectionProvider
simulation.hibernate.hikari.minimumIdle = 2
simulation.hibernate.hikari.maximumPoolSize = 5
simulation.hibernate.hikari.idleTimeout = 30000
#
simulation.results.role.owner = season
simulation.results.role.reader = season-reader
```
### SEASON simulations
To change the SEASON simulation to run each time a new SAFRAN integration is done, simply change the path `simulation.path.0`.
To add a second SEASON simulation, add a new path with `simulation.path.1`, and so on for other simulations.
The SEASON simulation format is described in the SEASON sources at `src/site/markdown/simulationproperties.md`.
### Runtime configuration
The other lines are for the configuration of JMS, JDBC and SEASON database roles.
This configuration must be adapted to the environment.