ecos-notifications-app

Purpose:

Notification delivery microservice image

Docker Compose service template:

notifications-app:
    logging:
      options:
        max-size: "10m"
        max-file: "5"
    image: nexus.citeck.ru/ecos-notifications:<NOTIFICATIONS_APP_IMAGE
    container_name: notifications-app
    hostname: notifications-app
    restart: unless-stopped
    stop_grace_period: 1m
    depends_on:
      - notifications-postgresql
    environment:
      - JHIPSTER_REGISTRY_PASSWORD=alfr3sc0
      - _JAVA_OPTIONS=-Xmx256m -Xms256m
      - SPRING_PROFILES_ACTIVE=prod,swagger
      - EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://admin:$${jhipster.registry.password}@jhipster-registry:8761/eureka
      - SPRING_CLOUD_CONFIG_URI=http://admin:$${jhipster.registry.password}@jhipster-registry:8761/config
      - SPRING_DATASOURCE_URL=jdbc:postgresql://notifications-postgresql:5432/notifications
      - JHIPSTER_SLEEP=140 # gives time for the JHipster Registry to boot before the application
      - ECOS-NOTIFICATIONS_EVENT_HOST=<ECOS-NOTIFICATIONS_EVENT_HOST
      - ECOS-NOTIFICATIONS_EVENT_PORT=<ECOS-NOTIFICATIONS_EVENT_PORT
      - ECOS-NOTIFICATIONS_EVENT_USERNAME=<ECOS-NOTIFICATIONS_EVENT_USERNAME
      - ECOS-NOTIFICATIONS_EVENT_PASSWORD=<ECOS-NOTIFICATIONS_EVENT_PASSWORD
      - ECOS-NOTIFICATIONS_ALFRESCO_URL=<ECOS-NOTIFICATIONS_ALFRESCO_URL
      - ECOS-NOTIFICATIONS_ALFRESCO_AUTHENTICATION_USERNAME=<ECOS-NOTIFICATIONS_ALFRESCO_AUTHENTICATION_USERNAME
      - ECOS-NOTIFICATIONS_ALFRESCO_AUTHENTICATION_PASSWORD=<ECOS-NOTIFICATIONS_ALFRESCO_AUTHENTICATION_PASSWORD
    ports:
      - 8013:8013
    volumes:
      - /opt/alfresco/logs/notifications:/tmp
      - /opt/micro/credentials:/credentials
    networks:
      - app_network
  # NOTIFICATIONS PSQL
  notifications-postgresql:
    image: postgres:10.4
    container_name: notifications-postgresql
    hostname: notifications-postgresql
    restart: unless-stopped
    stop_grace_period: 1m
    environment:
      - POSTGRES_USER=notifications
    volumes:
      - /opt/micro/postgresql/notifications:/var/lib/postgresql/data
    networks:
      - app_network

Used variables:

  • _JAVA_OPTIONS - parameters for jvm

  • SPRING_PROFILES_ACTIVE - profiles used during deployment

  • EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE - URL of the default eureka load balancer, contains credentials

  • SPRING_CLOUD_CONFIG_URI - URL of the cloud config server used, contains credentials

  • JHIPSTER_REGISTRY_PASSWORD - user password for authentication in eureka load balancer

  • SPRING_DATASOURCE_URL - URL of the postgresql datasource used

  • JHIPSTER_SLEEP - timeout before microservice deployment

  • ECOS-NOTIFICATIONS_EVENT_HOST - fqdn/ip of the rabbitmq message queue dispatcher

  • ECOS-NOTIFICATIONS_EVENT_PORT - amqp port of the rabbitmq message queue dispatcher

  • ECOS-NOTIFICATIONS_EVENT_USERNAME - rabbitmq message queue dispatcher user

  • ECOS-NOTIFICATIONS_EVENT_PASSWORD - rabbitmq message queue dispatcher password

  • ECOS-NOTIFICATIONS_ALFRESCO_URL - fqdn of the deployed ecos application

  • ECOS-NOTIFICATIONS_ALFRESCO_AUTHENTICATION_USERNAME - user in ecos for integration with the notification microservice

  • ECOS-NOTIFICATIONS_ALFRESCO_AUTHENTICATION_PASSWORD - user password in ecos for integration with the notification microservice

Typical log output for successful deployment:

notifications-app           | ----------------------------------------------------------
notifications-app           |   Application 'notifications' is running! Access URLs:
notifications-app           |   Local:          http://localhost:8013/
notifications-app           |   External:       http://172.26.0.22:8013/
notifications-app           |   Profile(s):     [prod, swagger]
notifications-app           | ----------------------------------------------------------
notifications-app           | 2020-05-14 05:59:30.204  INFO 1 --- [           main] r.c.ecos.notifications.NotificationsApp  :
notifications-app           | ----------------------------------------------------------
notifications-app           |   Config Server:  Connected to the JHipster Registry running in Docker
notifications-app           | ----------------------------------------------------------