0

I have 2 dockerized microserices which connect to postres container, but first container connects correctly, second fails. This is properties of order-service(which connects correctly):

spring.datasource.url=jdbc:postgresql://postgres:5431/order-service
spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.username=matvey
spring.datasource.password=matvey

Docker compose:

  postgres-order:
    container_name: postgres-order
    image: postgres
    environment:
      POSTGRES_DB: order-service
      POSTGRES_USER: matvey
      POSTGRES_PASSWORD: matvey
      PGDATA: /data/postgres
    volumes:
      - ./volumes/postgres-order:/data/postgres
    expose:
      - "5431"
    ports:
      - "5431:5431"
    command: -p 5431
    restart: unless-stopped

  order-service:
    container_name: order-service
    image: zaxarleningod/order-service
    environment:
      - SPRING_PROFILES_ACTIVE=docker
      - SPRING_DATASOURCE_URL=jdbc:postgresql://postgres-order:5431/order-service
    depends_on:
      - postgres-order
      - broker
      - discovery-server
      - api-gateway

This is inventory service properties(fails):

spring.datasource.url=jdbc:postgresql://postgres:5432/inventory-service
spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.username=matvey
spring.datasource.password=matvey

Docker compose:

  postgres-inventory:
    container_name: postgres-inventory
    image: postgres
    environment:
      POSTGRES_DB: inventory-service
      POSTGRES_USER: matvey
      POSTGRES_PASSWORD: matvey
      PGDATA: /data/postgres
    volumes:
      - ./volumes/postgres-inventory:/data/postgres
    ports:
      - "5432:5432"
    restart: unless-stopped

  #Inventory Service
  inventory-service:
    container_name: inventory-service
    image: zaxarleningod/inventory-service
    environment:
      - SPRING_PROFILES_ACTIVE=docker
      - SPRING_DATASOURCE_URL=jdbc:postgresql://postgres-inventory:5432/inventory-service
    depends_on:
      - postgres-inventory
      - discovery-server
      - api-gateway

I can understand what problem it is: enter image description here This is what i see in logs: enter image description here

  • What you see in the log is a warning (and please post logs as text with code blocks instead of an image as the latter is totally unreadable). – M. Deinum Feb 27 '23 at 09:02
  • Feels a bit of a duplicate of https://stackoverflow.com/questions/49110818/method-org-postgresql-jdbc-pgconnection-createclob-is-not-yet-implemented . Have you tried setting that property mentioned in the first answer? – M. Deinum Feb 27 '23 at 09:43

0 Answers0