Settings
JOpt.TourOptimizer reads its settings from environment variables when it starts. Set them on the container: with -e on docker run, in the environment block of a compose file, or in the env list of a Kubernetes pod. The defaults below are those of trusted mode. A setting that only auth mode reads is marked and links to the JOpt Platform, which sets it for you.
The diagram opens full size on click.
Value formats:
- A duration is an ISO 8601 duration such as
PT30MorP7D, or a number with a unit such as60sor2m. Where the table says so,UNLIMITEDis allowed too. - A size is a number with a unit such as
10GBor256MB, orUNLIMITEDwhere the table says so. - TourOptimizer checks its settings at the start. A value it cannot read, or a combination it does not allow, stops the start.
Choose the mode
| Variable | Default | What it does |
|---|---|---|
SPRING_PROFILES_ACTIVE | empty | Without the profile auth, TourOptimizer runs in trusted mode. With auth, it runs in auth mode and needs the services of the JOpt Platform stack. The profile cors allows calls from a browser on another origin. |
DNA_DEPLOYMENT_MODE | on-prem | on-prem or hosted. hosted refuses to start without the profile auth, with the profile cors, with the API documentation or the Swagger UI switched on, or with the example database login. |
Which mode fits which setup is on Choose a mode.
Server and API
| Variable | Default | What it does |
|---|---|---|
DNA_SERVER_PORT | 8081 | The port of the REST API |
DNA_SERVER_URL | / | The server URL that the OpenAPI schema names |
DNA_SERVER_HTTP2_ENABLED | true | HTTP/2, where the environment supports it |
DNA_SERVER_COMPRESSION_ENABLED | true | Compresses responses of the types in DNA_SERVER_COMPRESSION_MIME_TYPES (HTML, XML, text, CSS, JavaScript and JSON) |
DNA_SERVER_COMPRESSION_MIN_RESPONSE_SIZE | 1024 | Compresses a response only from this size in bytes |
DNA_FORWARD_HEADERS_STRATEGY | none | Forwarded and X-Forwarded-* headers are ignored, so a caller cannot change the address, host, scheme or path that TourOptimizer sees. Set native or framework only behind a proxy that overwrites these headers on every request. |
DNA_SHOW_SYNCH_CONTROLLERS | true | The synchronous runs and live streams (trusted mode) |
DNA_SHOW_DEPRECATED_CONTROLLERS | false | The endpoints of older releases |
DNA_DATABASE_FREE_SEARCH_ENABLED | true | The search endpoints of the jobs |
DNA_DATABASE_JOB_IMPORT_ENABLED | true | The job import (trusted mode) |
A request body may hold up to 250 MB. TourOptimizer has no list of allowed caller addresses: restrict callers by address at the network layer, with a firewall or a proxy.
API documentation
| Variable | Default | What it does |
|---|---|---|
DNA_API_DOCS_ENABLED | true | Serves the OpenAPI schema |
DNA_API_DOCS_PATH | /v3/api-docs | The path of the OpenAPI schema |
DNA_SWAGGER_UI_ENABLED | true | Serves the Swagger UI |
Switch both off on a server that callers outside your network can reach. The schema of each release is also on the API page.
License
In trusted mode each job carries its JOpt license in extension.keySetting.jsonLicense. A job without one uses the default license of the server:
| Variable | Default | What it does |
|---|---|---|
DNA_DEFAULT_LIC | empty | The license that a job without its own license runs with. Each use writes a warning to the log. |
A job with neither license is refused with 403 LICENSE_MISSING. In auth mode TourOptimizer ignores both: it removes the license of the request and runs the job with the license of the tenant from the JOpt Platform stack.
Database and jobs
Jobs, the job queue, stored results and webhooks need MongoDB.
| Variable | Default | What it does |
|---|---|---|
DNA_DATABASE_ACTIVE | false | Connects to MongoDB and turns on jobs. Auth mode needs it, since it runs optimizations only as jobs. |
DNA_DATABASE_URI | example value | The connection string of MongoDB, for example mongodb://<user>:<password>@<host>:27017. Always set your own. |
DNA_DATABASE_DB | touroptimizer | The name of the database. A missing database is created. |
DNA_DATABASE_DOWNLOAD_ACTIVE | false | The database read and write endpoints of older releases |
DNA_DATABASE_CLEAN_SECONDS | 7200 | How often, in seconds, the cleaner deletes data whose keep time has ended |
DNA_INSTANCE_ID_PREFIX | empty | The start of the name of this copy in the job records; empty uses the host name |
DNA_INSTANCE_HEARTBEAT_INTERVAL | 15s | How often each copy writes its heartbeat |
DNA_INSTANCE_LEASE | 2m | A running job of a copy whose heartbeat is older than this ends INTERRUPTED. At least three heartbeat intervals. |
Job queue and copies
How the queue works is on Jobs. The upload checks are on Checks and limits.
| Variable | Default in trusted mode | What it does |
|---|---|---|
DNA_RUN_CAPACITY | UNLIMITED | How many queued jobs this copy runs at a time, over all tenants |
DNA_QUEUE_CLAIM_INTERVAL | 1s | How often a copy with a free place looks for the next job |
DNA_QUEUE_MAX_WAIT | UNLIMITED | How long a job may wait. A job that waited longer ends CANCELLED with the stop reason QUEUE_WAIT_EXCEEDED. |
DNA_COPY_ROLE | both | accept serves the API and runs no job, run runs jobs and serves no API request, both does both |
DNA_DRAIN_PORT | empty | A port on 127.0.0.1 inside the copy, for a scaler that drains the copy before it removes it. Never publish it. |
DNA_MAX_SUBMITS_IN_FLIGHT | UNLIMITED | Job uploads that one copy receives at a time |
DNA_MAX_SUBMIT_BYTES_IN_FLIGHT | UNLIMITED | Bytes of the job uploads that one copy receives at a time |
DNA_MAX_SUBMITS_IN_FLIGHT_PER_TENANT | no effect | Job uploads of one tenant at a time (auth mode only) |
DNA_MAX_TOTAL_QUEUED_BYTES | UNLIMITED | The input of all waiting jobs together, over all copies |
DNA_SUBMIT_BODY_IDLE_TIMEOUT | PT60S | The longest pause between two parts of an upload |
DNA_STORAGE_RESERVE | 10GB | The free space that the MongoDB disk keeps; 0 turns the check off |
DNA_ORPHAN_INPUT_AGE | PT1H | When the input of an upload that never became a job is removed; at least PT2M |
In auth mode the stack sets its own values for these limits.
Run time and keep time
A job sets its max run time in extension.timeOut and its keep time in mongoSettings.expiry (Jobs). These settings apply when a job sets no value, and set the upper limit:
| Variable | Default in trusted mode | What it does |
|---|---|---|
DNA_RUN_TIME_MAX | UNLIMITED | The max run time of a job, counted from the start of the run. At the limit the run stops and keeps its best result. A longer timeOut is refused. |
DNA_KEEP_RESULTS_DEFAULT | PT48H | The keep time of a job that sets none, counted from the end of the run |
DNA_KEEP_RESULTS_MAX | UNLIMITED | The longest keep time a job may ask for. A longer expiry is refused. |
DNA_SYNC_RUN_TIME_MAX | PT1H | The max run time of a synchronous run; never UNLIMITED |
DNA_RUN_STOP_GRACE | 60s | A run that has not stopped this long after its limit ends ERROR |
In auth mode the plan of the account sets these limits.
Encryption
How stored results are encrypted is on Jobs.
| Variable | Default | What it does |
|---|---|---|
DNA_TO_MASTER_KEY | empty | Trusted mode: the master key of the server, 32 random bytes as base64 (for example from openssl rand -base64 32). With it, results are encrypted with a key per tenant. Empty: results are stored without encryption, and the start writes one warning. After a key change, a comma-separated list of v<n>:<base64> entries: the highest version encrypts, the others still decrypt. |
DNA_KMS_PROVIDER | none | local is a provider for development, in trusted mode only and never with a master key: its keys are kept in memory and lost on a restart. |
Auth mode does not read DNA_TO_MASTER_KEY: its master key comes from the secrets store of the JOpt Platform stack.
Webhooks
| Variable | Default | What it does |
|---|---|---|
DNA_WEBHOOK_VALIDATION | none | Which webhook URLs are allowed: strict, relaxed or none (Jobs) |
DNA_WEBHOOK_MAX_ATTEMPTS | 5 | How often a delivery is tried before it is given up |
Geo data
Geo data comes from GeoCoderRouter, which runs in the JOpt Platform stack (GeoCoderRouter).
| Variable | Default | What it does |
|---|---|---|
DNA_GEOCODERROUTER_BASE_URL | a local address | The address of GeoCoderRouter |
DNA_GCR_RESPONSE_TIMEOUT | 120s | How long TourOptimizer waits for an answer of GeoCoderRouter; then 504 |
DNA_GEOCODERROUTER_GEO_PROVIDER_ENABLED | true | The endpoint POST /api/v1/jobs/withGeoProvider |
DNA_GEOCODERROUTER_GEOCODING_ENABLED | true | The geocoding endpoint |
DNA_GEOCODING_PROVIDER, DNA_ROUTING_PROVIDER, DNA_MATRIX_PROVIDER | empty | The provider for a request that names none; empty uses the default of GeoCoderRouter |
Element limits
| Variable | Default | What it does |
|---|---|---|
DNA_HAS_ELEMENT_LIMITS | false | Limits the elements of an optimization |
DNA_ELEMENT_LIMITS_COUNT | 100 | The number of elements, when the limit is on |
The refusal is on Checks and limits.
Health and metrics
| Variable | Default | What it does |
|---|---|---|
DNA_MANAGEMENT_PORT | empty | Empty: the health endpoints answer on the API port, and no metrics are served. A port: the health endpoints move to that port, and the Prometheus metrics are served there at /actuator/prometheus, without a password. |
DNA_MANAGEMENT_ADDRESS | empty | The address of the management port. Empty: the address of this machine inside DNA_MANAGEMENT_SUBNET, else 127.0.0.1. |
DNA_MANAGEMENT_SUBNET | empty | The network in which the management port takes its address, when each copy needs its own |
DNA_MANAGEMENT_ADDRESS_FILE | empty | A file that the chosen address is written to, for a health check inside the container |
Never publish the management port: keep it on 127.0.0.1 or an internal network. It answers GET and HEAD only.
| Endpoint | Answers |
|---|---|
/actuator/health | The health of the process. The health check of the image reads it. |
/actuator/health/liveness | The process answers. |
/actuator/health/readiness | 503 unless every member is UP. In auth mode the members include the services of the JOpt Platform stack. |
GET /api/v1/health | The health on the API port |
Logging
| Variable | Default | What it does |
|---|---|---|
DNA_LOG_FORMAT | empty | Empty: plain lines. ecs (also logstash or gelf): one JSON object per line. |
DNA_LOG_OPTIMIZER_EVENTS | false | true writes every progress, status, warning and error event of every run to the log; for troubleshooting only |
Access protection in trusted mode
| Variable | Default | What it does |
|---|---|---|
DNA_SECURITY_ENABLED | false | true: every request needs a user name and password, with HTTP basic or form login |
DNA_USER | dna | The user name |
DNA_PASSWORD | none | The password. With DNA_SECURITY_ENABLED=true and no password, TourOptimizer does not start. |
In auth mode every request needs the token of the signed-in user or client, and these settings have no effect.
Settings of auth mode
In auth mode TourOptimizer reads further settings: the sign-in (issuer and audience of the tokens), the secrets store, the quota store, the client gates and the upper limits of a request. The JOpt Platform stack sets all of them. They are described with the stack:
- Who calls whom: sign-in, tenant and license source
- Operations: running and scaling the stack
Related pages
- Overview: what differs between the modes
- Jobs: submit, queue, run, state and result
- Checks and limits: the admission checks and the reason codes
- Choose a mode: which mode fits which setup
Added: 2026-11-27 | Last updated: 2026-11-27
Checks and limits
The checks JOpt.TourOptimizer runs before it stores a job, the size and load limits, and the reason code of every refusal.
Choose a mode
The three ways to run JOpt compared, the Java SDK in your own application, JOpt.TourOptimizer in trusted mode behind your backend, and JOpt.TourOptimizer in auth mode in the JOpt Platform stack.