diff options
Diffstat (limited to 'components/datalake-handler/feeder/src/main')
-rw-r--r-- | components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/Application.java | 16 | ||||
-rw-r--r-- | components/datalake-handler/feeder/src/main/resources/application.properties | 6 |
2 files changed, 16 insertions, 6 deletions
diff --git a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/Application.java b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/Application.java index 83f56b1d..22d19192 100644 --- a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/Application.java +++ b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/Application.java @@ -3,6 +3,7 @@ * ONAP : DataLake * ================================================================================ * Copyright 2019 China Mobile +* Copyright (C) 2021 Wipro Limited. *================================================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +21,13 @@ package org.onap.datalake.feeder; +import javax.sql.DataSource; + import org.onap.datalake.feeder.service.PullService; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.context.annotation.Bean; import springfox.documentation.swagger2.annotations.EnableSwagger2; @@ -41,9 +45,19 @@ public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } - + @Bean public CommandLineRunner commandLineRunner(PullService pullService) { return args -> pullService.start(); } + + @Bean + public DataSource dataSource() { + + String url = "jdbc:postgresql://" + System.getenv("PG_HOST").trim() + ":" + System.getenv("PG_PORT").trim() + + "/datalake"; + return DataSourceBuilder.create().url(url).username(System.getenv("PG_USER").trim()) + .password(System.getenv("PG_PASSWORD").trim()).build(); + } } + diff --git a/components/datalake-handler/feeder/src/main/resources/application.properties b/components/datalake-handler/feeder/src/main/resources/application.properties index bc24cdb2..0e5a81fd 100644 --- a/components/datalake-handler/feeder/src/main/resources/application.properties +++ b/components/datalake-handler/feeder/src/main/resources/application.properties @@ -19,11 +19,7 @@ defaultTopicName=_DL_DEFAULT_ spring.jpa.hibernate.ddl-auto=none spring.jpa.show-sql=false -#spring.datasource.driver-class-name=com.mysql.jdbc.Driver -spring.datasource.url=jdbc:mariadb://mariadb-galera:3306/datalake?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8 -spring.datasource.username=dl -spring.datasource.password=dl1234 - +spring.datasource.driver-class-name=org.hibernate.dialect.PostgreSQL9Dialect #####################DMaaP dmaapZookeeperHostPort=message-router-zookeeper:2181 |