Skip to content

Comments

[FEAT] 모듈 분리 #87

Open
waitAmhee wants to merge 48 commits intodevfrom
feature/#module_separation
Open

[FEAT] 모듈 분리 #87
waitAmhee wants to merge 48 commits intodevfrom
feature/#module_separation

Conversation

@waitAmhee
Copy link
Contributor

#️⃣연관된 이슈

#86

📝작업 내용

웹소켓용 모듈 분리

스크린샷 (선택)

💬리뷰 요구사항(선택)

배포 테스트 진행

waitAmhee and others added 26 commits November 3, 2025 22:43
…하기 때문에 infra 레벨의 관심사로 보여서 위치 이동 + 순환참조 문제를 해결하기 위해 @lazy 속성 사용
… 커스텀 메트릭 설정 3. 웹소켓 브로커 로그 발생 간격 30분 -> 30초로 수정
# Conflicts:
#	websocket/src/main/java/com/fintory/websocket/monitoring/config/StompStatsMetricsConfiguration.java
#	websocket/src/main/java/com/fintory/websocket/monitoring/config/WebSocketStatsConfig.java
@waitAmhee waitAmhee self-assigned this Nov 10, 2025
@waitAmhee waitAmhee added chore 문서, 설정, 유지보수 enhancement 기존 기능 개선 labels Nov 10, 2025
@waitAmhee waitAmhee linked an issue Nov 10, 2025 that may be closed by this pull request
Copy link
Contributor

@happyAndy0412 happyAndy0412 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

리팩토링 수고했습니다 👍

@GetMapping("/opened-market")
public ResponseEntity<ApiResponse<MarketStatusResponse>> getMarketStatus(){
return ResponseEntity.ok(ApiResponse.ok(websocketService.getMarketStatus()));
String url = "http://"+websocketServerUrl+":8080" + "/api/websocket/market/status";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 로직을 websocket 모듈 내에 있는 controller에 정의하지 않으신 이유가 있으신가요

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

처음에는 웹소켓 보다는 일반 장시간을 알려주는 기능이니 주 모듈의 common 컨트롤러에서 처리하는 것이 의미적 일관성이 있다고 판단했는데, 생각해보니 불필요한 HTTP 호출이 발생해서 Websocket 모듈로 옮기는 것이 더 효율적이네요! 수정하도록 하겠습니다! 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 근데 혹시 자주 호출되는 기능이면 현재 방식이 비효율적이라 websocket에 컨트롤러를 직접 추가하는게 나을 것 같은데
아니라면 webSocket 모듈은 Websocket 통신에만 집중하고 API Gateway 역할은 모두 app-child에서 처리하는 게 아키텍쳐 일관성 측면에서 좋은 것 같기도 해서요..! 어떤 방식이 적합할까요?!!?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

api 모듈에서 웹소켓 모듈의 api를 호출하는게 의미적으로도 안맞고 결합도도 증가시킬것같다는 차원에서 그렇게 생각했습니다 차라리 api만 child 모듈로 분리하고 싶으시면 클라이언트에서 openmarketapi 호출하고 반환값으로 웹소켓모듈에 요청하는게 나을 것 같습니다

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네네!! websocket 모듈로 옮기라는 말씀 맞으시죠? 수정하겠습니다! 👍

firebase:
config: ${FIREBASE_CONFIG}

websocket:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이부분도 만약 CommonStockControllerImpl.getMarketStatus 부분 websocket모듈로 옮기게 되면 해당 파일에는 필요없을거같습니다

import java.io.Serializable;
import java.math.BigDecimal;

@JsonIgnoreProperties(ignoreUnknown = true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저희 이거 혹시 현재가랑 코드만 가져오는 구조 아니었나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저는 프론트쪽에서 화면에 주식 변동률을 표시할 때 priceChangeRate 부분을 사용하고 있는 것으로 알고 있는데 아니라면 삭제하겠습니다!!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

변동률 프론트에서 계산하는 방식 아니었나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

웹소켓 모드에서는 증권사 서버에서 보내주는 값(realtimePriceChangeRate)이 있으면 그 값을 바로 사용하고 없으면 계산해서 화면에 보여주더라구요! 데이터 크기가 크지 않고, 정확도를 위해서는 현재 방식을 사용하는게 좋을 것 같은데 어떠세요?! 그리고 priceChange는 삭제하도록 하겠습니다! 👍 (혹시 제가 프론트 코드를 잘못 이해한거라면...죄송합니다 수정할게용 - ChangeRateStockListProps.tsx)

Copy link
Contributor

@happyAndy0412 happyAndy0412 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 👍

@GetMapping("/opened-market")
public ResponseEntity<ApiResponse<MarketStatusResponse>> getMarketStatus(){
return ResponseEntity.ok(ApiResponse.ok(websocketService.getMarketStatus()));
String url = "http://"+websocketServerUrl+":8080" + "/api/websocket/market/status";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

api 모듈에서 웹소켓 모듈의 api를 호출하는게 의미적으로도 안맞고 결합도도 증가시킬것같다는 차원에서 그렇게 생각했습니다 차라리 api만 child 모듈로 분리하고 싶으시면 클라이언트에서 openmarketapi 호출하고 반환값으로 웹소켓모듈에 요청하는게 나을 것 같습니다

import java.io.Serializable;
import java.math.BigDecimal;

@JsonIgnoreProperties(ignoreUnknown = true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

변동률 프론트에서 계산하는 방식 아니었나요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore 문서, 설정, 유지보수 enhancement 기존 기능 개선

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 모듈 분리

2 participants