-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from sazzeo/config-server/actuator
Config server/actuator
- Loading branch information
Showing
16 changed files
with
201 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
spring: | ||
cloud: | ||
config: | ||
uri: http://127.0.0.1:8888 # config-server url | ||
name: ecommerce # *.yml name | ||
profiles: | ||
active: gateway #application-profile.yml 중 profile 명 기입 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
d-user-service/src/main/java/com/example/duserservice/config/EnvironmentDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.example.duserservice.config; | ||
|
||
|
||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor | ||
@Data | ||
public class EnvironmentDto { | ||
|
||
private String serverPort; | ||
private String localServerPort; | ||
private String tokenSecret; | ||
private String tokenExpirationTime; | ||
|
||
|
||
@Builder | ||
public EnvironmentDto(String serverPort, String localServerPort, String tokenSecret, String tokenExpirationTime) { | ||
this.serverPort = serverPort; | ||
this.localServerPort = localServerPort; | ||
this.tokenSecret = tokenSecret; | ||
this.tokenExpirationTime = tokenExpirationTime; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
spring: | ||
cloud: | ||
config: | ||
uri: http://127.0.0.1:8888 # config-server url | ||
name: ecommerce # *.yml name | ||
profiles: | ||
active: user-service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
dependencies { | ||
|
||
developmentOnly 'org.springframework.boot:spring-boot-devtools' | ||
implementation 'org.springframework.cloud:spring-cloud-config-server:3.1.3' | ||
|
||
} | ||
|
||
|
||
dependencyManagement { | ||
imports { | ||
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}" | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
e-config-service/src/main/java/com/example/econfigservice/ConfigServiceApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.example.econfigservice; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.cloud.config.server.EnableConfigServer; | ||
|
||
@SpringBootApplication | ||
@EnableConfigServer | ||
public class ConfigServiceApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(ConfigServiceApplication.class, args); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
server: | ||
port: 8888 | ||
|
||
spring: | ||
application: | ||
name: config-service | ||
cloud: | ||
config: | ||
server: | ||
git: | ||
# uri: C:\code\study\msa-spring-cloud-config # local git repository path | ||
uri: https://github.com/sazzeo/mas-config-yml-repo # remote git repository path | ||
# username: private repository 이용시 설정 추가 | ||
# password: | ||
|
||
|
||
# git이 아닌 로컬 폴더 이용시 | ||
#spring: | ||
# application: | ||
# name: config-service | ||
# profiles: | ||
# active : native | ||
# cloud: | ||
# config: | ||
# server: | ||
# native: | ||
# search-locations: #로컬 폴더명 |
13 changes: 13 additions & 0 deletions
13
...nfig-service/src/test/java/com/example/econfigservice/EConfigServiceApplicationTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.example.econfigservice; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
|
||
@SpringBootTest | ||
class EConfigServiceApplicationTests { | ||
|
||
@Test | ||
void contextLoads() { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,33 @@ | ||
# MSA Toy Project | ||
# Spring Cloud Config | ||
|
||
``` text | ||
spring cloud config 로 yml파일 한번에 관리하기 | ||
``` | ||
MSA Toy Project만들어보기 | ||
``` | ||
1. e-config-service | ||
2. d-user-service | ||
3. d-gateway-service | ||
4. ecommerce (Eureka Server) | ||
|
||
1. d-user-service | ||
2. d-order-service | ||
3. d-category-service | ||
4. d-gateway-service | ||
5. ecommerce (Eureka Server) | ||
## Config | ||
|
||
## Eureka Server | ||
1. e-config-service | ||
|
||
1.ecommerce | ||
```text | ||
- Spring Cloud Config Server 의존성 추가 | ||
- application.yml 파일에 remote / local git repository 주소 등록 설정 | ||
``` | ||
|
||
|
||
## Service | ||
## service | ||
|
||
1. d-user-service | ||
2. d-order-service | ||
3. category-service | ||
2. d-gateway-service | ||
|
||
|
||
### User Service | ||
|
||
```text | ||
- 스프링 sequrity로 로그인 서비스 구축 | ||
- Authentication Filter | ||
- jwt 로 토큰 발행후 Response 헤더 추가 | ||
- Spring Cloud Config 의존성 추가 | ||
- actuator , bootstrap 의존성 추가 | ||
- config-server 정보를 bootstrap.yml 파일에 추가 | ||
- actuator endpoint 정보를 application.yml 파일에 추가 | ||
``` | ||
|
||
## Gateway | ||
|
||
1. d-api-gateway-service | ||
|
||
>AuthorizationHeaderFilter로 요청 token을 파싱해 유효값 확인 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters