---
# Container descriptor
- descriptor: "pip-services:context-info:default:default:1.0"
  name: "firemap"
  description: "firemap microservice"

# Console logger
- descriptor: "pip-services:logger:console:default:1.0"
  level: "trace"

# Perfomance counter that post values to log
- descriptor: "pip-services:counters:log:default:1.0"

{{#if MEMORY_ENABLED}}
# In-memory persistence. Use only for testing!
- descriptor: "eic-stopfires-services-firemap:persistence:memory:default:1.0"
{{/if}}

{{#if FILE_ENABLED}}
# File persistence
- descriptor: "eic-stopfires-services-firemap:persistence:file:default:1.0"
  path: {{FILE_PATH}}{{^FILE_PATH}}"./data/firemap.json"{{/FILE_PATH}}
{{/if}}
    
{{#if MONGO_ENABLED}}
# MongoDb persistence
- descriptor: "eic-stopfires-services-firemap:persistence:mongodb:default:1.0"
  connection:
    uri: {{MONGO_SERVICE_URI}}
    host: {{MONGO_SERVICE_HOST}}{{^MONGO_SERVICE_HOST}}"localhost"{{/MONGO_SERVICE_HOST}}
    port: {{MONGO_SERVICE_PORT}}{{^MONGO_SERVICE_PORT}}27017{{/MONGO_SERVICE_PORT}}
    database: {{MONGO_DB}}{{^MONGO_DB}}"firemap"{{/MONGO_DB}}
{{/if}}

{{#unless MEMORY_ENABLED}}{{#unless FILE_ENABLED}}{{#unless MONGO_ENABLED}}
# In-memory persistence. Use only for testing!
- descriptor: "eic-stopfires-services-firemap:persistence:memory:default:1.0"
{{/unless}}{{/unless}}{{/unless}}

{{#if KAFKA_ENABLED}}
# Kafka Messaging
- descriptor: "pip-services:message-queue:kafka:{{WEBSOCKDATA_TOPIC}}{{#unless WEBSOCKDATA_TOPIC}}websock-data{{/unless}}:1.0"
  topic: {{WEBSOCKDATA_TOPIC}}{{#unless WEBSOCKDATA_TOPIC}}websock-data{{/unless}}
  group_id: facade-data
  connection:
    protocol: tcp
    host: {{{KAFKA_SERVICE_HOST}}}{{#unless KAFKA_SERVICE_HOST}}localhost{{/unless}}
    port: {{KAFKA_SERVICE_PORT}}{{#unless KAFKA_SERVICE_PORT}}9092{{/unless}}
  credential:
    mechanism: {{KAFKA_MECHANISM}}{{#unless KAFKA_MECHANISM}}plain{{/unless}}
    username: {{KAFKA_USER}}
    password: "{{{KAFKA_PASS}}}"
{{/if}}

# Controller
- descriptor: "eic-stopfires-services-firemap:controller:default:default:1.0"

# Common HTTP endpoint
- descriptor: "pip-services:endpoint:http:default:1.0"
  connection:
    protocol: http
    host: 0.0.0.0
    port: {{HTTP_PORT}}{{#unless HTTP_PORT}}8080{{/unless}}

# HTTP endpoint service version 1.0
- descriptor: "eic-stopfires-services-firemap:service:commandable-http:default:1.0"
  swagger:
    enable: true
    
# Hearbeat service
- descriptor: "pip-services:heartbeat-service:http:default:1.0"

# Status service
- descriptor: "pip-services:status-service:http:default:1.0"

# Swagger service
- descriptor: "pip-services:swagger-service:http:default:1.0"
