-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: ๐ง Redisson Auto Configuration ์ ๊ฑฐ ๋ฐ ๋๋ฉ์ธ ๋ชจ๋ ์์กด ์ ์ด (#151)
* feat: pennyway domain config group ์ด๊ฑฐ ํ์ ์ ์ * feat: domain config ์ธํฐํ์ด์ค ๋ฐ ์ด๋ ธํ ์ด์ ์ ์ * feat: domain config import select ๊ตฌํ * chore: redisson @configuration ์ ๊ฑฐ, config group ์์ ์ถ๊ฐ * rename: distributed lock aop -> aspect * chore: batch ๋ชจ๋ redisson auth configure exclude * chore: auto configurate ์ต์ domain yml๋ก ์ด์ * chore: redisson ๊ด๋ จ ํด๋์ค ๋ชจ๋ @component ์ ๊ฑฐ -> ์๋ bean ๋ฑ๋ก * chore: api ๋ชจ๋ domain config์ redisson ์ค์ ์ถ๊ฐ * test: redisson ํ ์คํธ disabled
- Loading branch information
1 parent
1d6a1ca
commit a67b589
Showing
13 changed files
with
109 additions
and
14 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
pennyway-app-external-api/src/main/java/kr/co/pennyway/api/config/DomainConfig.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,12 @@ | ||
package kr.co.pennyway.api.config; | ||
|
||
import kr.co.pennyway.domain.common.importer.EnablePennywayDomainConfig; | ||
import kr.co.pennyway.domain.common.importer.PennywayDomainConfigGroup; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
@EnablePennywayDomainConfig({ | ||
PennywayDomainConfigGroup.REDISSON | ||
}) | ||
public class DomainConfig { | ||
} |
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 |
---|---|---|
|
@@ -20,6 +20,11 @@ spring: | |
hikari: | ||
maximum-pool-size: 2 | ||
|
||
data: | ||
redis: | ||
repositories: | ||
enabled: false | ||
|
||
--- | ||
spring: | ||
config: | ||
|
2 changes: 0 additions & 2 deletions
2
pennyway-domain/src/main/java/kr/co/pennyway/domain/common/aop/CallTransactionFactory.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
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
15 changes: 15 additions & 0 deletions
15
...omain/src/main/java/kr/co/pennyway/domain/common/importer/EnablePennywayDomainConfig.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 kr.co.pennyway.domain.common.importer; | ||
|
||
import org.springframework.context.annotation.Import; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Target(ElementType.TYPE) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Import(PennywayDomainConfigImportSelector.class) | ||
public @interface EnablePennywayDomainConfig { | ||
PennywayDomainConfigGroup[] value(); | ||
} |
7 changes: 7 additions & 0 deletions
7
...yway-domain/src/main/java/kr/co/pennyway/domain/common/importer/PennywayDomainConfig.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,7 @@ | ||
package kr.co.pennyway.domain.common.importer; | ||
|
||
/** | ||
* Pennyway Domain์ Configurations๋ฅผ ๋ํ๋ด๋ Marker Interface | ||
*/ | ||
public interface PennywayDomainConfig { | ||
} |
13 changes: 13 additions & 0 deletions
13
...domain/src/main/java/kr/co/pennyway/domain/common/importer/PennywayDomainConfigGroup.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 kr.co.pennyway.domain.common.importer; | ||
|
||
import kr.co.pennyway.domain.config.RedissonConfig; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public enum PennywayDomainConfigGroup { | ||
REDISSON(RedissonConfig.class); | ||
|
||
private final Class<? extends PennywayDomainConfig> configClass; | ||
} |
24 changes: 24 additions & 0 deletions
24
...c/main/java/kr/co/pennyway/domain/common/importer/PennywayDomainConfigImportSelector.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,24 @@ | ||
package kr.co.pennyway.domain.common.importer; | ||
|
||
import kr.co.pennyway.common.util.MapUtils; | ||
import org.springframework.context.annotation.DeferredImportSelector; | ||
import org.springframework.core.type.AnnotationMetadata; | ||
import org.springframework.lang.NonNull; | ||
|
||
import java.util.Arrays; | ||
import java.util.Map; | ||
|
||
public class PennywayDomainConfigImportSelector implements DeferredImportSelector { | ||
@NonNull | ||
@Override | ||
public String[] selectImports(@NonNull AnnotationMetadata metadata) { | ||
return Arrays.stream(getGroups(metadata)) | ||
.map(v -> v.getConfigClass().getName()) | ||
.toArray(String[]::new); | ||
} | ||
|
||
private PennywayDomainConfigGroup[] getGroups(AnnotationMetadata metadata) { | ||
Map<String, Object> attributes = metadata.getAnnotationAttributes(EnablePennywayDomainConfig.class.getName()); | ||
return (PennywayDomainConfigGroup[]) MapUtils.getObject(attributes, "value", new PennywayDomainConfigGroup[]{}); | ||
} | ||
} |
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