server:
  port: ${pcp.ports.request:7005}

pcp:
  outbox:
    request-status-topic: pcp.request.status.v1
    publish-batch-size: 50
    publish-fixed-delay-ms: 5000
    max-attempts: 10
    initial-backoff-ms: 1000
    max-backoff-ms: 60000
  request:
    expiry:
      enabled: true
      fixed-delay-ms: 60000
      batch-size: 200
      max-batches-per-run: 50

spring:
  boot:
    admin:
      client:
        instance:
          service-base-url: ${pcp.services.request}
          service-path: /swagger/ui
          management-base-url: ${pcp.services.request}
  datasource:
    driver-class-name: org.postgresql.Driver
    url: "${SPRING_DATASOURCE_URL}"
    username: "${SPRING_DATASOURCE_USERNAME}"
    password: "${SPRING_DATASOURCE_PASSWORD}"
  jpa:
    hibernate:
      ddl-auto: validate
    properties:
      hibernate:
        format_sql: true
  flyway:
    enabled: true
    baseline-on-migrate: true
    locations: classpath:db/migration
  kafka:
    bootstrap-servers: ${pcp.infra.kafka.host}:${pcp.infra.kafka.port}
    consumer:
      group-id: pcp-request-service
      auto-offset-reset: latest
      key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
      value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
    producer:
      key-serializer: org.apache.kafka.common.serialization.StringSerializer
      value-serializer: org.apache.kafka.common.serialization.StringSerializer

springdoc:
  swagger-ui:
    path: /swagger/ui

management:
  endpoints:
    web:
      exposure:
        include: health,info,metrics

logging:
  level:
    root: INFO
    org.hibernate.SQL: WARN
    org.springframework.kafka: INFO

app:
  kafka:
    topics:
      route: pcp.route.georeference.v1
    consumer:
      route:
        dlq-topic: pcp.route.georeference-dlq.v1
        max-attempts: 5
        backoff-ms: 1000
        max-backoff-ms: 30000
  grid:
    enabled: true

---
spring:
  config:
    activate:
      on-profile: local
  datasource:
    driver-class-name: org.postgresql.Driver
    url: jdbc:postgresql://${pcp.infra.postgres.host}:${pcp.infra.postgres.port}/pcp_requests
    username: postgres
    password: password
