You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by ma...@apache.org on 2022/11/22 09:21:21 UTC

[fineract-cn-accounting] branch develop updated: Remove eureka & client side loadbalancer

This is an automated email from the ASF dual-hosted git repository.

manojvm pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-accounting.git


The following commit(s) were added to refs/heads/develop by this push:
     new cefba12  Remove eureka & client side loadbalancer
     new 9849ce5  Merge pull request #23 from BLasan/remove-eureka
cefba12 is described below

commit cefba12b2b37487defe6003c3302fba52e13cdc4
Author: BLasan <be...@gmail.com>
AuthorDate: Wed Jun 1 21:06:04 2022 +0530

    Remove eureka & client side loadbalancer
---
 .../cn/accounting/api/v1/client/LedgerManager.java |  2 +-
 .../cn/accounting/AbstractAccountingTest.java      |  1 -
 service/build.gradle                               |  2 +-
 .../service/AccountingServiceConfiguration.java    |  2 --
 service/src/main/resources/application.yml         | 24 +++++++++++++++-------
 5 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/api/src/main/java/org/apache/fineract/cn/accounting/api/v1/client/LedgerManager.java b/api/src/main/java/org/apache/fineract/cn/accounting/api/v1/client/LedgerManager.java
index dd8e0b1..771c81d 100644
--- a/api/src/main/java/org/apache/fineract/cn/accounting/api/v1/client/LedgerManager.java
+++ b/api/src/main/java/org/apache/fineract/cn/accounting/api/v1/client/LedgerManager.java
@@ -50,7 +50,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 
 @SuppressWarnings("unused")
-@FeignClient(value = "accounting-v1", path = "/accounting/v1", configuration = CustomFeignClientsConfiguration.class)
+@FeignClient(value = "${kubernetes.accounting.service.name}", path = "/accounting/v1", url = "http://${kubernetes.accounting.service.name}:${kubernetes.accounting.server.port}", configuration = CustomFeignClientsConfiguration.class)
 public interface LedgerManager {
 
   @RequestMapping(
diff --git a/component-test/src/main/java/org/apache/fineract/cn/accounting/AbstractAccountingTest.java b/component-test/src/main/java/org/apache/fineract/cn/accounting/AbstractAccountingTest.java
index d9c7237..fdac058 100644
--- a/component-test/src/main/java/org/apache/fineract/cn/accounting/AbstractAccountingTest.java
+++ b/component-test/src/main/java/org/apache/fineract/cn/accounting/AbstractAccountingTest.java
@@ -96,7 +96,6 @@ public class AbstractAccountingTest extends SuiteTestEnvironment{
   @Configuration
   @EnableEventRecording
   @EnableFeignClients(basePackages = {"org.apache.fineract.cn.accounting.api.v1"})
-  @RibbonClient(name = APP_NAME)
   @Import({AccountingServiceConfiguration.class})
   @ComponentScan("org.apache.fineract.cn.accounting.listener")
   public static class TestConfiguration {
diff --git a/service/build.gradle b/service/build.gradle
index dacca72..8887a02 100644
--- a/service/build.gradle
+++ b/service/build.gradle
@@ -44,7 +44,7 @@ bootRepackage {
 dependencies {
     compile(
             [group: 'org.springframework.cloud', name: 'spring-cloud-starter-config'],
-            [group: 'org.springframework.cloud', name: 'spring-cloud-starter-eureka'],
+            [group: 'org.springframework.boot', name: 'spring-boot-starter-web'],
             [group: 'org.springframework.boot', name: 'spring-boot-starter-jetty'],
             [group: 'org.apache.fineract.cn.accounting', name: 'api', version: project.version],
             [group: 'org.apache.fineract.cn.customer', name: 'api', version: versions.frameworkcustomer],
diff --git a/service/src/main/java/org/apache/fineract/cn/accounting/service/AccountingServiceConfiguration.java b/service/src/main/java/org/apache/fineract/cn/accounting/service/AccountingServiceConfiguration.java
index 840ccc9..a457242 100644
--- a/service/src/main/java/org/apache/fineract/cn/accounting/service/AccountingServiceConfiguration.java
+++ b/service/src/main/java/org/apache/fineract/cn/accounting/service/AccountingServiceConfiguration.java
@@ -29,7 +29,6 @@ import org.apache.fineract.cn.postgresql.config.EnablePostgreSQL;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.netflix.feign.EnableFeignClients;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
@@ -39,7 +38,6 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
 
 @Configuration
 @EnableAutoConfiguration
-@EnableDiscoveryClient
 @EnableAsync
 @EnableTenantContext
 @EnablePostgreSQL
diff --git a/service/src/main/resources/application.yml b/service/src/main/resources/application.yml
index 234f0b3..7b921c6 100644
--- a/service/src/main/resources/application.yml
+++ b/service/src/main/resources/application.yml
@@ -24,13 +24,6 @@ spring:
     config:
       enabled: false
 
-eureka:
-  client:
-    serviceUrl:
-      defaultZone: http://localhost:8761/eureka/
-  instance:
-    homePageUrl: "http://${eureka.hostname}:2025/accounting/v1/"
-
 server:
   port: 2025
   contextPath: /accounting/v1/*
@@ -69,3 +62,20 @@ async:
 
 flyway:
   enabled: false
+
+kubernetes:
+  accounting:
+    service:
+      name: accounting-service
+    server:
+      port: 2025
+  customer:
+    service:
+      name: customer-service
+    server:
+      port: 2024
+
+ribbon:
+  eureka:
+    enabled: false
+