-
Notifications
You must be signed in to change notification settings - Fork 0
[UNI-377] refactor: 로컬캐시 도입 & 비동기 로깅 & Fastjson HTTP response 적용 #242
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
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
aedbbee
feat: Caffeine 로컬 캐시 구현
mikekks 492685a
feat: Log4j2 비동기 로거 구현
mikekks bb823e5
feat: fastjson 기반 HttpMessageConverter 구현
mikekks 7195ff6
refactor: redis -> local cache 로 코드 수정
mikekks 17bb575
fix: 미사용 API 제거
mikekks d6f8eb9
fix: redis 의존 삭제
mikekks 8a9c226
fix: 테스트 코드 redis 의존 삭제
mikekks 2fb3d89
refactor: 캐시 서비스 재사용성 높게 리팩토링
mikekks 3da7a06
chore: 로그 스타일 변경
mikekks 4f9437c
fix: db 기존 Url로 수정
mikekks 76f2031
refactor: 캐시 관련 인터페이스화하여 개선
mikekks cf65e08
chore: TTL 수정
mikekks 521e7d8
chore: 서버 이전으로 디렉토리 위치 수정
mikekks 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
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
29 changes: 29 additions & 0 deletions
29
uniro_backend/src/main/java/com/softeer5/uniro_backend/common/config/CaffeineConfig.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,29 @@ | ||
| package com.softeer5.uniro_backend.common.config; | ||
|
|
||
| import java.util.concurrent.TimeUnit; | ||
|
|
||
| import org.springframework.cache.CacheManager; | ||
| import org.springframework.cache.annotation.EnableCaching; | ||
| import org.springframework.cache.caffeine.CaffeineCacheManager; | ||
| import org.springframework.context.annotation.Bean; | ||
| import org.springframework.context.annotation.Configuration; | ||
|
|
||
| import com.github.benmanes.caffeine.cache.Caffeine; | ||
|
|
||
| @Configuration | ||
| @EnableCaching | ||
| public class CaffeineConfig { | ||
| @Bean | ||
| public CacheManager cacheManager() { | ||
| CaffeineCacheManager cacheManager = new CaffeineCacheManager("lightRoutes", "tmp"); // 여러 개의 캐시 네임 설정 가능 | ||
| cacheManager.setCaffeine(caffeineConfig()); | ||
| return cacheManager; | ||
| } | ||
|
|
||
| public Caffeine<Object, Object> caffeineConfig() { | ||
| return Caffeine.newBuilder() | ||
| .expireAfterWrite(36, TimeUnit.HOURS) // 36시간 후 캐시 만료 | ||
| .maximumSize(3000) // 최대 3000개 저장 | ||
| .recordStats(); // 캐시 통계 활성화 | ||
| } | ||
| } |
35 changes: 0 additions & 35 deletions
35
uniro_backend/src/main/java/com/softeer5/uniro_backend/common/config/RedisConfig.java
This file was deleted.
Oops, something went wrong.
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
48 changes: 0 additions & 48 deletions
48
uniro_backend/src/main/java/com/softeer5/uniro_backend/external/redis/RedisService.java
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
uniro_backend/src/main/java/com/softeer5/uniro_backend/map/cache/RouteCacheService.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,19 @@ | ||
| package com.softeer5.uniro_backend.map.cache; | ||
|
|
||
| import com.softeer5.uniro_backend.map.service.vo.LightRoutes; | ||
|
|
||
| public interface RouteCacheService { | ||
| LightRoutes getLightRoutes(Long univId, int batchNumber); | ||
|
|
||
| void saveLightRoutes(Long univId, int batchNumber, LightRoutes value); | ||
|
|
||
| boolean hasLightRoutes(Long univId, int batchNumber); | ||
|
|
||
| Integer getFetchSize(Long univId); | ||
|
|
||
| void saveFetchSize(Long univId, Integer fetchSize); | ||
|
|
||
| boolean hasFetchSize(Long univId); | ||
|
|
||
| void deleteFetchSizeAndLightRoutesByUnivId(Long univId); | ||
| } |
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.