diff --git a/README.md b/README.md index 30acdb9..60d86c5 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@
-![version 0.1.2](https://img.shields.io/badge/version-0.1.2-black?labelColor=black&style=flat-square) ![jdk 17](https://img.shields.io/badge/jdk-17-orange?labelColor=black&style=flat-square) +![version 0.1.4](https://img.shields.io/badge/version-0.1.2-black?labelColor=black&style=flat-square) ![jdk 17](https://img.shields.io/badge/jdk-17-orange?labelColor=black&style=flat-square) @@ -19,11 +19,11 @@ Choreography 방식으로 구현된 분산 트랜잭션 라이브러리 입니 ## How to use -Netx는 스프링 환경에서 사용할 수 있으며, 아래와 같이 `@AutoConfigureRedisTransaction` 어노테이션을 붙이는것으로 손쉽게 사용할 수 있습니다. +Netx는 스프링 환경에서 사용할 수 있으며, 아래와 같이 `@EnableDistributedTransaciton` 어노테이션을 붙이는것으로 손쉽게 사용할 수 있습니다. ```kotlin @SpringBootApplication -@AutoConfigureDistributedTransaction +@EnableDistributedTransaciton @EnableAutoConfiguration(exclude = [RedisReactiveAutoConfiguration::class]) class Application { @@ -36,7 +36,7 @@ class Application { } ``` -`@AutoConfigureDistributedTransaction` 어노테이션으로 자동 구성할 경우 netx는 아래 프로퍼티를 사용해 메시지 큐와 커넥션을 맺습니다. +`@EnableDistributedTransaciton` 어노테이션으로 자동 구성할 경우 netx는 아래 프로퍼티를 사용해 메시지 큐와 커넥션을 맺습니다. #### Properties @@ -131,7 +131,6 @@ fun handleTransactionRollbackEvent(event: TransactionRollbackEvent) { ## Download ```groovy - repositories { maven { url "https://jitpack.io" } } diff --git a/build.gradle b/build.gradle index e9761c0..244ea84 100644 --- a/build.gradle +++ b/build.gradle @@ -17,6 +17,16 @@ version = "${version}" sourceCompatibility = "${compatibility}" targetCompatibility = "${compatibility}" +jar { + enabled = true + from { + configurations.runtimeClasspath.collect { + it.isDirectory() ? it : zipTree(it) + } + } + duplicatesStrategy = DuplicatesStrategy.EXCLUDE +} + repositories { mavenCentral() } diff --git a/gradle.properties b/gradle.properties index a26f5c1..b50df30 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ kotlin.code.style=official ### Project ### group=org.rooftop.netx -version=0.1.2 +version=0.1.4 compatibility=17 ### Protobuf ### diff --git a/src/main/kotlin/org/rooftop/netx/autoconfig/AutoConfigureDistributedTransaction.kt b/src/main/kotlin/org/rooftop/netx/autoconfig/AutoConfigureDistributedTransaction.kt deleted file mode 100644 index 42278e7..0000000 --- a/src/main/kotlin/org/rooftop/netx/autoconfig/AutoConfigureDistributedTransaction.kt +++ /dev/null @@ -1,9 +0,0 @@ -package org.rooftop.netx.autoconfig - -import org.rooftop.netx.redis.RedisTransactionConfigurer -import org.springframework.boot.autoconfigure.ImportAutoConfiguration - -@Target(AnnotationTarget.CLASS) -@Retention(AnnotationRetention.RUNTIME) -@ImportAutoConfiguration(RedisTransactionConfigurer::class) -annotation class AutoConfigureDistributedTransaction diff --git a/src/main/kotlin/org/rooftop/netx/autoconfig/EnableDistributedTransaction.kt b/src/main/kotlin/org/rooftop/netx/autoconfig/EnableDistributedTransaction.kt new file mode 100644 index 0000000..aa5a32e --- /dev/null +++ b/src/main/kotlin/org/rooftop/netx/autoconfig/EnableDistributedTransaction.kt @@ -0,0 +1,9 @@ +package org.rooftop.netx.autoconfig + +import org.rooftop.netx.redis.RedisTransactionConfigurer +import org.springframework.context.annotation.Import + +@Target(AnnotationTarget.CLASS) +@Retention(AnnotationRetention.RUNTIME) +@Import(RedisTransactionConfigurer::class) +annotation class EnableDistributedTransaction diff --git a/src/main/resources/META-INF/spring/spring.factories b/src/main/resources/META-INF/spring/spring.factories new file mode 100644 index 0000000..60c397d --- /dev/null +++ b/src/main/resources/META-INF/spring/spring.factories @@ -0,0 +1,2 @@ +org.rooftop.netx.autoconfig.EnableDistributedTransaction=\ +org.rooftop.netx.redis.RedisTransactionConfigurer diff --git a/src/test/kotlin/org/rooftop/netx/redis/RedisStreamTransactionManagerTest.kt b/src/test/kotlin/org/rooftop/netx/redis/RedisStreamTransactionManagerTest.kt index 3cfa906..7884dc5 100644 --- a/src/test/kotlin/org/rooftop/netx/redis/RedisStreamTransactionManagerTest.kt +++ b/src/test/kotlin/org/rooftop/netx/redis/RedisStreamTransactionManagerTest.kt @@ -5,13 +5,13 @@ import io.kotest.core.annotation.DisplayName import io.kotest.core.spec.style.DescribeSpec import io.kotest.matchers.shouldBe import org.rooftop.netx.api.* -import org.rooftop.netx.autoconfig.AutoConfigureDistributedTransaction +import org.rooftop.netx.autoconfig.EnableDistributedTransaction import org.springframework.test.context.ContextConfiguration import org.springframework.test.context.TestPropertySource import reactor.test.StepVerifier import kotlin.time.Duration.Companion.minutes -@AutoConfigureDistributedTransaction +@EnableDistributedTransaction @ContextConfiguration( classes = [ EventCapture::class, diff --git a/src/test/kotlin/org/rooftop/netx/redis/RedisStreamTransactionRemoverTest.kt b/src/test/kotlin/org/rooftop/netx/redis/RedisStreamTransactionRemoverTest.kt index 4b9adef..e863714 100644 --- a/src/test/kotlin/org/rooftop/netx/redis/RedisStreamTransactionRemoverTest.kt +++ b/src/test/kotlin/org/rooftop/netx/redis/RedisStreamTransactionRemoverTest.kt @@ -7,13 +7,13 @@ import io.kotest.matchers.shouldBe import org.rooftop.netx.api.TransactionCommitEvent import org.rooftop.netx.api.TransactionManager import org.rooftop.netx.api.TransactionRollbackEvent -import org.rooftop.netx.autoconfig.AutoConfigureDistributedTransaction +import org.rooftop.netx.autoconfig.EnableDistributedTransaction import org.springframework.test.context.ContextConfiguration import org.springframework.test.context.TestPropertySource import reactor.core.scheduler.Schedulers import kotlin.time.Duration.Companion.seconds -@AutoConfigureDistributedTransaction +@EnableDistributedTransaction @ContextConfiguration( classes = [ RedisContainer::class,