connect Spring Cloud DataFlow and Postgresql-db by docker-compose

Viewed 198

I tryed to configure containerization by using the following docker-compose.yaml:

 services:

   postgresql:
     image: postgres:13.1
     container_name: dataflow-postgresql
     environment:
       POSTGRES_DB: test_source
       POSTGRES_USER: root
       POSTGRES_PASSWORD: rootpw
     expose:
       - 5433

   dataflow-server:
      image: springcloud/spring-cloud-dataflow-server
      container_name: dataflow-server
      ports:
        - "9393:9393"
      depends_on:
        - postgresql
   
   skipper-server:
      image: springcloud/spring-cloud-skipper-server
      container_name: skipper
      ports:
         - "7577:7577"
         - ${APPS_PORT_RANGE:-20000-20105:20000-20105}

Containers successfully runs.

In dataflow I create stream with standart jdbc-application. In url-option I use:

     jdbc:postgresql://postgresql:5433/test_source

Database is exist.

In postgresql.conf I prescribe port 5433 (to prevent conflict with 5432 at localhost-postgresql).

For docker-connectin I use default net.

As a result I gain in logs:

at org.springframework.boot.jdbc.AbstractDataSourceInitializer.initialize(AbstractDataSourceInitializer.java:53) ~[spring-boot-2.1.13.RELEASE.jar!/:2.1.13.RELEASE]

According to documentation, in string 53 of this class:

return false;  

in method:

private boolean isEnabled() {
    if (this.getMode() == DataSourceInitializationMode.NEVER) {
        return false;
    } else {
        return this.getMode() != DataSourceInitializationMode.EMBEDDED || EmbeddedDatabaseConnection.isEmbedded(this.dataSource);
    }
}
 

What am I doing wrong?

1 Answers

The problem solved by settind the value "org.postgresql.Driver" to property "driver-class-name"

Related