Skip to content

Commit

Permalink
Add docs for BatchJobObservationConvention, BatchStepObservationConve…
Browse files Browse the repository at this point in the history
…ntion

Signed-off-by: Taeik Lim <[email protected]>
  • Loading branch information
acktsap committed Apr 14, 2024
1 parent af78ec4 commit d7b3555
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 1 deletion.
24 changes: 24 additions & 0 deletions doc/en/configuration/kotlin-dsl/job/job-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- [Set a listener using annotations](#set-a-listener-using-annotations)
- [Set a listener using a JobExecutionListener object](#set-a-listener-using-a-jobexecutionlistener-object)
- [Set a MeterRegistry](#set-a-meterregistry)
- [Set a BatchJobObservationConvention](#set-a-batchjobobservationconvention)
- [Set a ObservationRegistry](#set-a-observationregistry)
- [Set preventRestart](#set-preventrestart)
- [Set a Repository](#set-a-repository)
Expand Down Expand Up @@ -165,6 +166,29 @@ open class TestJobConfig(
}
```

## Set a BatchJobObservationConvention

The Kotlin DSL helps you set a `BatchJobObservationConvention` using `JobBuilder`.

```kotlin
@Configuration
open class TestJobConfig(
private val batch: BatchDsl,
private val transactionManager: PlatformTransactionManager,
) {

@Bean
open fun testJob(): Job = batch {
job("testJob") {
observationConvention(DefaultBatchJobObservationConvention())
step("testStep") {
tasklet({ _, _ -> RepeatStatus.FINISHED }, transactionManager)
}
}
}
}
```

## Set a ObservationRegistry

The Kotlin DSL helps you set a `ObservationRegistry` using `JobBuilder`.
Expand Down
24 changes: 24 additions & 0 deletions doc/en/configuration/kotlin-dsl/step/step-configuration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Step Configuration

- [Set a job repository](#set-a-job-repository)
- [Set a BatchStepObservationConvention](#set-a-batchstepobservationconvention)
- [Set a ObservationRegistry](#set-a-observationregistry)
- [Set a MeterRegistry](#set-a-meterregistry)
- [Set startLimit](#set-startlimit)
Expand Down Expand Up @@ -42,6 +43,29 @@ open class TestJobConfig(
}
```

## Set a BatchStepObservationConvention

The Kotlin DSL helps you set a `BatchStepObservationConvention` using `StepBuilder`.

```kotlin
@Configuration
open class TestJobConfig(
private val batch: BatchDsl,
private val transactionManager: PlatformTransactionManager,
) {

@Bean
open fun testJob(): Job = batch {
job("testJob") {
step("testStep") {
observationConvention(DefaultBatchStepObservationConvention())
tasklet({ _, _ -> RepeatStatus.FINISHED }, transactionManager)
}
}
}
}
```

## Set a ObservationRegistry

The Kotlin DSL helps you set a `ObservationRegistry` using `StepBuilder`.
Expand Down
25 changes: 25 additions & 0 deletions doc/ko/configuration/kotlin-dsl/job/job-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- [Annotation을 사용해서 Listener 설정하기](#annotation을-사용해서-listener-설정하기)
- [JobExecutionListener 객체를 사용하여 Listener 설정하기](#jobexecutionlistener-객체를-사용하여-listener-설정하기)
- [MeterRegistry 설정하기](#meterregistry-설정하기)
- [BatchJobObservationConvention 설정하기](#batchjobobservationconvention-설정하기)
- [ObservationRegistry 설정하기](#observationregistry-설정하기)
- [PreventRestart 설정하기](#preventrestart-설정하기)
- [Repository 설정하기](#repository-설정하기)
Expand Down Expand Up @@ -165,6 +166,30 @@ open class TestJobConfig(
}

```

## BatchJobObservationConvention 설정하기

Kotlin DSL은 `JobBuilder`를 사용해서 `BatchJobObservationConvention` 설정을 하는 방법을 제공합니다.

```kotlin
@Configuration
open class TestJobConfig(
private val batch: BatchDsl,
private val transactionManager: PlatformTransactionManager,
) {

@Bean
open fun testJob(): Job = batch {
job("testJob") {
observationConvention(DefaultBatchJobObservationConvention())
step("testStep") {
tasklet({ _, _ -> RepeatStatus.FINISHED }, transactionManager)
}
}
}
}
```

## ObservationRegistry 설정하기

Kotlin DSL은 `JobBuilder`를 사용해서 `ObservationRegistry` 설정을 하는 방법을 제공합니다.
Expand Down
26 changes: 25 additions & 1 deletion doc/ko/configuration/kotlin-dsl/step/step-configuration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Step Configuration

- [Job Repository 설정](#job-repository-설정)
- [BatchStepObservationConvention 설정](#batchstepobservationconvention-설정)
- [ObservationRegistry 설정](#observationregistry-설정)
- [MeterRegistry 설정](#meterregistry-설정)
- [StartLimit 설정](#startlimit-설정)
Expand Down Expand Up @@ -42,6 +43,29 @@ open class TestJobConfig(
}
```

## BatchStepObservationConvention 설정

Kotlin DSL은 `StepBuilder`를 사용하여 `BatchStepObservationConvention`을 설정하는 방법을 제공합니다.

```kotlin
@Configuration
open class TestJobConfig(
private val batch: BatchDsl,
private val transactionManager: PlatformTransactionManager,
) {

@Bean
open fun testJob(): Job = batch {
job("testJob") {
observationConvention(DefaultBatchJobObservationConvention())
step("testStep") {
tasklet({ _, _ -> RepeatStatus.FINISHED }, transactionManager)
}
}
}
}
```

## ObservationRegistry 설정

Kotlin DSL은 `StepBuilder`를 사용하여 `ObservationRegistry`을 설정하는 방법을 제공합니다.
Expand Down Expand Up @@ -229,4 +253,4 @@ open class TestJobConfig(
}
}
}
```
```

0 comments on commit d7b3555

Please sign in to comment.