Skip to content

Commit 7ed94f8

Browse files
config server implementation done
1 parent 3c8af86 commit 7ed94f8

File tree

15 files changed

+38
-170
lines changed

15 files changed

+38
-170
lines changed

core-banking-service/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ dependencies {
2929
implementation 'org.springframework.boot:spring-boot-starter-web'
3030
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
3131
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
32+
33+
//SPRING CLOUD CONFIG
34+
implementation 'org.springframework.cloud:spring-cloud-starter-config'
35+
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'
36+
3237
compileOnly 'org.projectlombok:lombok'
3338
annotationProcessor 'org.projectlombok:lombok'
3439
implementation 'org.flywaydb:flyway-core:8.0.3'
Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,3 @@
11
spring:
22
application:
33
name: core-banking-service
4-
datasource:
5-
url: jdbc:mysql://localhost:3306/banking_core_service
6-
username: root
7-
password: password
8-
jpa:
9-
hibernate:
10-
ddl-auto: none
11-
12-
server:
13-
port: 8092
14-
15-
eureka:
16-
client:
17-
service-url:
18-
defaultZone: http://localhost:8081/eureka
19-
20-
info:
21-
app:
22-
name: ${spring.application.name}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
spring:
2+
cloud:
3+
config:
4+
uri: http://localhost:8090

internet-banking-api-gateway/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ dependencies {
2121
implementation 'org.springframework.cloud:spring-cloud-starter-gateway'
2222
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
2323

24+
//SPRING CLOUD CONFIG
25+
implementation 'org.springframework.cloud:spring-cloud-starter-config'
26+
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'
27+
2428
compileOnly 'org.projectlombok:lombok'
2529
annotationProcessor 'org.projectlombok:lombok'
2630

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,3 @@
11
spring:
22
application:
33
name: internet-banking-api-gateway
4-
5-
## API SECURITY WITH KEYCLOAK PROVIDER
6-
security:
7-
oauth2:
8-
client:
9-
provider:
10-
keycloak:
11-
authorization-uri: ${app.config.keycloak.url}/realms/${app.config.keycloak.realm}/protocol/openid-connect/auth
12-
jwk-set-uri: ${app.config.keycloak.url}/realms/${app.config.keycloak.realm}/protocol/openid-connect/certs
13-
token-uri: ${app.config.keycloak.url}/realms/${app.config.keycloak.realm}/protocol/openid-connect/token
14-
user-info-authentication-method: header
15-
user-info-uri: ${app.config.keycloak.url}/realms/${app.config.keycloak.realm}/protocol/openid-connect/userinfo
16-
user-name-attribute: preferred_username
17-
registration:
18-
internet-banking-core-client:
19-
authorization-grant-type: authorization_code
20-
client-id: ${app.config.keycloak.client-id}
21-
client-secret: ${app.config.keycloak.client-secret}
22-
provider: keycloak
23-
redirect-uri: http://localhost:8080/login/oauth2/code/keycloak
24-
scope: openid
25-
resourceserver:
26-
jwt:
27-
jwk-set-uri: ${app.config.keycloak.url}/realms/${app.config.keycloak.realm}/protocol/openid-connect/certs
28-
29-
## GATEWAY CONFIGURATIONS
30-
cloud:
31-
gateway:
32-
routes:
33-
## USER SERVICE
34-
- id: internet-banking-user-service
35-
uri: lb://internet-banking-user-service
36-
predicates:
37-
- Path=/user/**
38-
filters:
39-
- StripPrefix=1
40-
## FUND TRANSFER SERVICE
41-
- id: internet-banking-fund-transfer-service
42-
uri: lb://internet-banking-fund-transfer-service
43-
predicates:
44-
- Path=/fund-transfer/**
45-
filters:
46-
- StripPrefix=1
47-
## CORE BANKING SERVICE
48-
- id: core-banking-service
49-
uri: lb://core-banking-service
50-
predicates:
51-
- Path=/banking-core/**
52-
filters:
53-
- StripPrefix=1
54-
## UTILITY PAYMENTS SERVICE
55-
- id: internet-banking-utility-payment-service
56-
uri: lb://internet-banking-utility-payment-service
57-
predicates:
58-
- Path=/utility-payment/**
59-
filters:
60-
- StripPrefix=1
61-
62-
## SECURITY BASED CONFIGURATIONS
63-
app:
64-
config:
65-
keycloak:
66-
url: http://localhost:8080/auth
67-
realm: javatodev-internet-banking
68-
client-secret: 150a5b40-1719-47f9-9056-1b35e16ede74
69-
client-id: internet-banking-core-client
70-
71-
server:
72-
port: 8082
73-
74-
eureka:
75-
client:
76-
service-url:
77-
defaultZone: http://localhost:8081/eureka
78-
fetch-registry: true
79-
register-with-eureka: true
80-
instance:
81-
hostname: localhost
82-
prefer-ip-address: true
83-
84-
logging:
85-
level:
86-
org.springframework.cloud.gateway: DEBUG
87-
reactor.netty.http.client: DEBUG
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
spring:
2+
cloud:
3+
config:
4+
uri: http://localhost:8090

internet-banking-fund-transfer-service/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ dependencies {
2121
implementation 'org.springframework.boot:spring-boot-starter-web'
2222
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
2323
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
24+
//SPRING CLOUD CONFIG
25+
implementation 'org.springframework.cloud:spring-cloud-starter-config'
26+
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'
2427
runtimeOnly 'mysql:mysql-connector-java'
2528
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
2629
compileOnly 'org.projectlombok:lombok'
Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,3 @@
1-
server:
2-
port: 8084
3-
41
spring:
52
application:
63
name: internet-banking-fund-transfer-service
7-
datasource:
8-
url: jdbc:mysql://localhost:3306/banking_core_fund_transfer_service
9-
username: root
10-
password: password
11-
jpa:
12-
hibernate:
13-
ddl-auto: update
14-
15-
eureka:
16-
client:
17-
service-url:
18-
defaultZone: http://localhost:8081/eureka
19-
20-
info:
21-
app:
22-
name: ${spring.application.name}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
spring:
2+
cloud:
3+
config:
4+
uri: http://localhost:8090

internet-banking-user-service/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ dependencies {
2222
implementation 'org.springframework.boot:spring-boot-starter-web'
2323
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
2424
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
25+
//SPRING CLOUD CONFIG
26+
implementation 'org.springframework.cloud:spring-cloud-starter-config'
27+
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'
2528
implementation ('org.springframework.cloud:spring-cloud-starter-netflix-eureka-client') {
2629
exclude group: 'javax.ws.rs', module: 'jsr311-api'
2730
}

0 commit comments

Comments
 (0)