Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<br>


![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)

<img src = "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/rooftop-MSA/Netx/assets/62425964/5082ef20-10ad-4b6b-bff8-7e78a0f9e01f" width="500" align="right"/>

Expand All @@ -19,11 +19,11 @@ Choreography 방식으로 구현된 분산 트랜잭션 라이브러리 입니

## How to use

Netx는 스프링 환경에서 사용할 수 있으며, 아래와 같이 `@AutoConfigureRedisTransaction` 어노테이션을 붙이는것으로 손쉽게 사용할 수 있습니다.
Netx는 스프링 환경에서 사용할 수 있으며, 아래와 같이 `@EnableDistributedTransaciton` 어노테이션을 붙이는것으로 손쉽게 사용할 수 있습니다.

```kotlin
@SpringBootApplication
@AutoConfigureDistributedTransaction
@EnableDistributedTransaciton
@EnableAutoConfiguration(exclude = [RedisReactiveAutoConfiguration::class])
class Application {

Expand All @@ -36,7 +36,7 @@ class Application {
}
```

`@AutoConfigureDistributedTransaction` 어노테이션으로 자동 구성할 경우 netx는 아래 프로퍼티를 사용해 메시지 큐와 커넥션을 맺습니다.
`@EnableDistributedTransaciton` 어노테이션으로 자동 구성할 경우 netx는 아래 프로퍼티를 사용해 메시지 큐와 커넥션을 맺습니다.

#### Properties

Expand Down Expand Up @@ -131,7 +131,6 @@ fun handleTransactionRollbackEvent(event: TransactionRollbackEvent) {
## Download

```groovy

repositories {
maven { url "https://jitpack.io" }
}
Expand Down
10 changes: 10 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kotlin.code.style=official

### Project ###
group=org.rooftop.netx
version=0.1.2
version=0.1.4
compatibility=17

### Protobuf ###
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions src/main/resources/META-INF/spring/spring.factories
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
org.rooftop.netx.autoconfig.EnableDistributedTransaction=\
org.rooftop.netx.redis.RedisTransactionConfigurer
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down