-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
The main configuration for all of the microservices is the config.yaml file.
In the repo there's a copy called config-example.yaml which you can use as a guide but this page describes all options.
The file is broken up into multiple sections, most are optional and best to leave them as is.
The ftp section defines details on accessing the NREOD ftp server and used by the reference microservices darwinref & darwintt.
ftp:
enabled: true
password: "your password"
schedule: "0 30 2-6 * * *"
property | type | required | description |
---|---|---|---|
enabled | boolean | yes | If this is not set to true then the ftp server will not be used |
server | string | no | The remote server, defaults to "datafeeds.nationalrail.co.uk:21" |
user | string | no | The ftp user, defaults to "ftpuser" |
password | string | yes | The password as provided by the nre data portal" |
schedule | string | no | The schedule to use to look for updates |
Note: The schedule "0 30 2-6 * * *" is the one I use. This will check the ftp server at half past the hour between 2 & 6 am every day.
This defines the connection to RabbitMQ, used by the darwind3 and ldb microservices.
rabbitmq:
url: amqp://user:pass@rabbit.example.com
connectionName: LDB Departure Boards
property | type | required | description |
---|---|---|---|
url | string | yes | The connection string to connect to your RabbitMQ server |
connectionName | string | no | Label's the connection within RabbitMQ's management plugin |
This configures the darwind3 microservice.
d3:
resolveSchedules: true
queueName: my.d3
routingKey: nre.push
property | type | required | description |
---|---|---|---|
resovleSchedules | boolean | no | If true then if the service receives an update for an unknown schedule it will attempt to resolve it from the darwintt service |
queueName | string | yes | The name of the queue to create for receiving messages from NRE |
routingKey | string | yes | The routingKey to bind to the queue. This should be the routingKey for the raw messages from NRE |
This is optional but allows you to log and expose statistics, usually message rates, being processed by the services.
statistics:
log: true
rest: /stats
schedule: "0 * * * * *"
property | type | required | description |
---|---|---|---|
log | boolean | no | If true then once a minute the statistics are logged to the docker log |
rest | string | no | If set then the path to expose within the microservices web server |
schedule | string | no | The schedule to update statistics, defaults to once per minute |
This section allows you to define the url's the microservice will use to talk to each other, specifically darwind3 and ldb use these.
The url's should be up to but not including the first / of the relevant microservice. The scheme and hostname defined here should be that of the public endpoint (see Traefik) so that the request's are routed to the correct instance.
services:
reference: https://ref.example.com
timetable: https://timetable.example.com
darwind3: https://d3.example.com
ldb: https://ldb.example.com
property | type | required | description |
---|---|---|---|
reference | URL | yes | Url of the darwinref service |
timetable | URL | yes | URL of the darwintt service |
darwind3 | URL | yes | URL of the darwind3 service |
ldb | URL | yes | URL of the ldb service |
This section configures the microservices own webserver. It's totally optional and unlikely you would want to change this.
server:
port: 8080
context: /path
property | type | required | description |
---|---|---|---|
port | integer | no | The port to listen to, defaults to 80 |
context | string | no | Prefix to apply to all endpoints in this service. Defaults to "" |
This section configures where the microservices store their data. It's totally optional and unlikely you would want to change this.
database:
path: /database
reference: dwref.db
timetable: dwtt.db
pushPort: dwd3.db
property | type | required | description |
---|---|---|---|
path | string | no | The path to the database directory, defaults to "/database" which is defined as a volume within the image. |
reference | string | no | Database within path for darwinref - defaults to dwref.db |
timetable | string | no | Database within path for darwintt - defaults to dwtt.db |
pushPort | string | no | Database within path for darwind3 - defaults to dwd3.db |