owsybl-ws-commons.1.14.0.source-code.application.yaml Maven / Gradle / Ivy
# to have the hostname in /actuator/info
info:
hostname: ${HOSTNAME:}
server:
# for springdoc swagger-ui behind a reverse proxy (X-FORWARDED-*)
forward-headers-strategy: framework
# for exception messages in the returned json for errors
error:
include-message: always
# increase max url length
max-http-header-size: 64000
# enable monitoring of tomcat threads and thread pool
tomcat:
mbeanregistry:
enabled: true
logging:
level:
# To print db information at startup for postgres
com.zaxxer.hikari.HikariConfig: DEBUG
org.springframework.jdbc.datasource.SimpleDriverDataSource: DEBUG
management:
endpoints:
web:
exposure:
include: health, info, prometheus
info:
git:
mode: full
spring:
# to have webservices connect to localhost in IDEs
profiles:
active: default,local
# to allow to upload big networks
servlet:
multipart:
max-file-size: 100MB
max-request-size: 103MB
codec:
max-in-memory-size: 100MB
# rabbitmq default host/port
rabbitmq:
addresses: rabbitmq
port: 5672
# for now, for both r2dbc and jdbc. Also for now with the same user
# as the app, but this should be changed
liquibase:
url: jdbc:${powsybl-ws.database.url}
user: ${powsybl-ws.database.login}
password: ${powsybl-ws.database.password}
# for microservices with r2dbc
r2dbc:
url: r2dbc:${powsybl-ws.database.url}
username: ${powsybl-ws.database.login}
password: ${powsybl-ws.database.password}
pool:
# note: r2dbc pool 0.8.x (and probably 0.9.x) doesn't have a minimumIdle, so it will close all connections if idle.
# This is still better than having many connections open and idle. Someday if they add support we can configure minimumIdle here
# 1 connection instead of 10 at startup
initial-size: 1
# for microservices with jpa/hibernate
datasource:
url: jdbc:${powsybl-ws.database.url}
username: ${powsybl-ws.database.login}
password: ${powsybl-ws.database.password}
# we have many microservices connecting to the same db,
# change the minimum idle from 10 to 1 by default
hikari:
minimum-idle: 1
jpa:
database: POSTGRESQL
hibernate:
ddl-auto: validate
properties:
dialect: org.hibernate.dialect.PostgreSQLDialect
hibernate:
format_sql: true
# Used when action: create is uncommented
hbm2ddl:
delimiter: ;
query:
# Explicitly fail the warning "HHH000104: firstResult/maxResults specified with collection fetch; applying in memory!"
fail_on_pagination_over_collection_fetch: true
# Uncomment action to automatically generate the database sql schema file
javax:
persistence:
schema-generation:
scripts:
#action: create
create-target: src/main/resources/${powsybl-ws.database.name}.sql
create-source: metadata
# for microservices with elasticsearch
data:
elasticsearch:
host: elasticsearch
port: 9200
client:
timeout: 60 # Seconds
# disable reactive client autoconfiguration because we don't use it and it is
# not configured so it tries to connect to localhost which fails. This means
# we get an ugly error message at startup, and more importantly that the
# health probes fail, so things like k8s think the server is not working and
# don't route traffic to it and keep the previous deployment. We have to do
# this because the reactiveclient is automatically used by springboot when
# starter-webflux is used.
autoconfigure:
exclude:
- org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchReactiveHealthContributorAutoConfiguration
- org.springframework.boot.autoconfigure.data.elasticsearch.ReactiveElasticsearchRepositoriesAutoConfiguration
- org.springframework.boot.autoconfigure.data.elasticsearch.ReactiveElasticsearchRestClientAutoConfiguration
powsybl-ws:
environment:
# To set elasticsearch index names prefixes (default empty)
# please use a separator '_' at prefix end for readability
elasticsearch:
index:
prefix: ${powsybl-ws.environment:}
# To set rabbitmq bidings destination prefixes (default empty)
# please use a separator '_' at prefix end for readability
rabbitmq:
destination:
prefix: ${powsybl-ws.environment:}
database:
# default values
vendor: postgresql
host: postgres
port: 5432
login: postgres
password: postgres
# use this to set common query parameters, and use the predefined
# '${queryBegin}' marker to put the correct leading char '?' or '&' depending
# on whether the microservice has predefined query parameters.
# for example, use this (with the ${} and all): query=${queryBegin}timeout=5&reconnect=true
query:
# these allow to customize the url construction a bit for weird connection strings
hostPort: ://${powsybl-ws.database.host}:${powsybl-ws.database.port}/
prefix: ${powsybl-ws.database.databaseOrSchema.prefix:}
protocolHost: ${powsybl-ws.database.vendor}${powsybl-ws.database.hostPort}
fullName: ${powsybl-ws.database.prefix}${powsybl-ws.database.name}
finalQuery: ${powsybl-ws.database.customQuery}${powsybl-ws.database.query}
manyBasesPath: ${powsybl-ws.database.fullName}${powsybl-ws.database.finalQuery}
commonName:
manySchemasPath: ${powsybl-ws.database.commonName}?currentSchema=${powsybl-ws.database.fullName}${powsybl-ws.database.finalQuery}
urlManyBases: ${powsybl-ws.database.protocolHost}${powsybl-ws.database.manyBasesPath}
urlManySchemas: ${powsybl-ws.database.protocolHost}${powsybl-ws.database.manySchemasPath}
# leave this if you want 1 database per microservice
url: ${powsybl-ws.database.urlManyBases}
# use this if you want 1 database for all microservice, each in a schema
# and set commonName in application.yaml, and set queryBegin: '&' and customQueryBegin: '&' in application.yaml
# url=${powsybl-ws.database.urlManySchemas}
# To set postgres database or schema prefixes (default empty)
# please use a separator '_' at prefix end for readability
databaseOrSchema:
prefix: ${powsybl-ws.environment:}
# customQuery allows a microservice to set query parameters specific to itself.
# if customQuery is empty, set queryBegin to "?", otherwise set it to "&".
# this allow the user to add additional query elements common to all microservices
# and to use the appropriate leading character depending on whether the microsevice
# uses custom query parameters or not. customQueryBegin in this file must always be '?',
# it is present only to be able to be overriden by deployments in the
# manyschemas mode. It is used only for microservices that have predefined
# query parameters, and it must be used if customQuery is not empty, otherwise
# the manyschema mode doesn't work, so define it everywhere because it doesn't
# hurt.
queryBegin: '?'
customQueryBegin: '?'
customQuery:
#name: