-
Notifications
You must be signed in to change notification settings - Fork 2
Feat/trade core #150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Feat/trade core #150
Changes from 14 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
0d6667d
test: 성능테스트 환경 구성
caniro bd56c24
feat: 체결 확정 수량이 0인 경우, 문제가 되는 주문은 큐에서 제거되도록 개선
caniro d0ce068
Merge branch 'dev' into feat/trade-core
caniro 3626640
chore: 불필요 클래스 삭제
caniro b9ce729
feat: 종목을 DB에서 조회하도록 변경(아직 사용되는 단계는 아니지만 선반영)
caniro 6fd5caa
fix: 체결 예외 시 복구 후 다음 쌍을 매칭하도록 로직 수정
caniro a65d001
config: add gitignore
Junh-b e4d5773
feat: 체결 단일스레드 처리로 변경
Junh-b 9dc0656
feat: handling concurrency
Junh-b da06ed3
refactor: OrderService의 참조 Repository 변경
Junh-b 9c4ab86
test: OrderService 동시성 테스트 추가
Junh-b b3b583c
test: orderservice 동시성 적용버전
Junh-b 2af0560
fix: READ_COMMITTED 및 비관적 락 사용을 통한 동시성 문제 해소
caniro 5a7c2f6
chore: 불필요 테스트 삭제
caniro f1ca7a6
add: account, wallet 인덱스 추가
caniro dadc814
config: 필수 config 재수정
Junh-b cbe002a
refactor: Account, Wallet 레포지터리 통일
Junh-b e6af112
Merge branch 'dev' into feat/trade-core
caniro 164c6b1
chore: typo(static method 호출)
caniro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -38,4 +38,7 @@ out/ | |
|
|
||
| ### 로컬 환경변수 ### | ||
| local.properties | ||
| /logs | ||
| /logs | ||
| docker-compose.override.yml | ||
|
|
||
| dd-java-agent.jar | ||
This file contains hidden or 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 hidden or 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
28 changes: 28 additions & 0 deletions
28
src/main/java/com/cleanengine/coin/common/annotation/TransactionLoggingAspect.java
This file contains hidden or 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,28 @@ | ||
| package com.cleanengine.coin.common.annotation; | ||
|
|
||
| import org.aspectj.lang.ProceedingJoinPoint; | ||
| import org.aspectj.lang.annotation.Around; | ||
| import org.aspectj.lang.annotation.Aspect; | ||
| import org.slf4j.MDC; | ||
| import org.springframework.stereotype.Component; | ||
|
|
||
| import java.util.UUID; | ||
|
|
||
| @Aspect | ||
| @Component | ||
| public class TransactionLoggingAspect { | ||
|
|
||
| private static final String TRANSACTION_ID_KEY = "txId"; | ||
|
|
||
| @Around("@annotation(org.springframework.transaction.annotation.Transactional)") | ||
| public Object logTransaction(ProceedingJoinPoint joinPoint) throws Throwable { | ||
| String txId = UUID.randomUUID().toString().substring(0, 8); | ||
| MDC.put(TRANSACTION_ID_KEY, txId); | ||
|
|
||
| try { | ||
| return joinPoint.proceed(); | ||
| } finally { | ||
| MDC.remove(TRANSACTION_ID_KEY); | ||
| } | ||
| } | ||
| } |
6 changes: 6 additions & 0 deletions
6
...a/com/cleanengine/coin/order/adapter/out/persistentce/account/OrderAccountRepository.java
This file contains hidden or 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,10 +1,16 @@ | ||
| package com.cleanengine.coin.order.adapter.out.persistentce.account; | ||
|
|
||
| import com.cleanengine.coin.user.domain.Account; | ||
| import jakarta.persistence.LockModeType; | ||
caniro marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| import jakarta.persistence.QueryHint; | ||
| import org.springframework.data.jpa.repository.Lock; | ||
| import org.springframework.data.jpa.repository.QueryHints; | ||
| import org.springframework.data.repository.CrudRepository; | ||
|
|
||
| import java.util.Optional; | ||
|
|
||
| public interface OrderAccountRepository extends CrudRepository<Account, Integer> { | ||
| @Lock(LockModeType.PESSIMISTIC_WRITE) | ||
| // @QueryHints({@QueryHint(name = "jakarta.persistence.lock.timeout", value = "3000")}) | ||
| Optional<Account> findByUserId(Integer userId); | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.