diff --git a/jdbc/shedlock/pom.xml b/jdbc/shedlock/pom.xml index 1700236..2e8fa7a 100644 --- a/jdbc/shedlock/pom.xml +++ b/jdbc/shedlock/pom.xml @@ -1,4 +1,5 @@ - + 4.0.0 tech.ydb.jdbc.examples @@ -12,8 +13,9 @@ 17 1.9.22 - 0.1.0 + 0.3.0 3.1.2 + 1.1.0 @@ -32,10 +34,6 @@ shedlock-spring 4.27.0 - - org.springframework.boot - spring-boot-starter-web - org.springframework.boot spring-boot-autoconfigure @@ -48,6 +46,15 @@ org.springframework.boot spring-boot-starter-jdbc + + tech.ydb.dialects + liquibase-ydb-dialect + ${liquibase.ydb.dialect.version} + + + org.liquibase + liquibase-core + org.jetbrains.kotlin kotlin-reflect @@ -70,7 +77,6 @@ ${project.basedir}/src/main/kotlin - ${project.basedir}/src/test/kotlin org.apache.maven.plugins diff --git a/jdbc/shedlock/src/main/kotlin/tech/ydb/shaded/lock/JobHandler.kt b/jdbc/shedlock/src/main/kotlin/tech/ydb/shaded/lock/JobHandler.kt index 5979cb5..ce46811 100644 --- a/jdbc/shedlock/src/main/kotlin/tech/ydb/shaded/lock/JobHandler.kt +++ b/jdbc/shedlock/src/main/kotlin/tech/ydb/shaded/lock/JobHandler.kt @@ -1,12 +1,8 @@ package tech.ydb.shaded.lock -import jakarta.annotation.PostConstruct import net.javacrumbs.shedlock.spring.annotation.SchedulerLock -import org.springframework.beans.factory.annotation.Autowired import org.springframework.scheduling.annotation.Scheduled import org.springframework.stereotype.Component -import tech.ydb.lock.provider.YdbCoordinationServiceLockProvider - /** * @author Kirill Kurdyukov @@ -15,12 +11,16 @@ import tech.ydb.lock.provider.YdbCoordinationServiceLockProvider class JobHandler { @Scheduled(cron = "* * * * * *") - @SchedulerLock(name = "YDB Some Job", lockAtLeastFor = "15S", lockAtMostFor = "20S") + @SchedulerLock(name = "YDB Some Job", lockAtMostFor = "10S") fun awesomeJob() { + println("PID LEADER: " + ProcessHandle.current().pid()) + for (i in 0..4) { println("Processing {$i}") Thread.sleep(1_000) } + + println("STOP LEADER") } } \ No newline at end of file diff --git a/jdbc/shedlock/src/main/resources/application.properties b/jdbc/shedlock/src/main/resources/application.properties index a565c01..c7ea4a5 100644 --- a/jdbc/shedlock/src/main/resources/application.properties +++ b/jdbc/shedlock/src/main/resources/application.properties @@ -1,3 +1,4 @@ spring.datasource.url=jdbc:ydb:grpc://localhost:2136/local spring.datasource.driver-class-name=tech.ydb.jdbc.YdbDriver -server.port=81 \ No newline at end of file + +spring.liquibase.change-log=classpath:changelog.xml diff --git a/jdbc/shedlock/src/main/resources/changelog.xml b/jdbc/shedlock/src/main/resources/changelog.xml new file mode 100644 index 0000000..5966efd --- /dev/null +++ b/jdbc/shedlock/src/main/resources/changelog.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jdbc/spring-data-jdbc/pom.xml b/jdbc/spring-data-jdbc/pom.xml index 21c09d1..88d7651 100644 --- a/jdbc/spring-data-jdbc/pom.xml +++ b/jdbc/spring-data-jdbc/pom.xml @@ -22,7 +22,7 @@ 17 1.9.22 - 0.9.1 + 1.0.0 3.2.1 10.7.1 diff --git a/jdbc/spring-data-jpa/pom.xml b/jdbc/spring-data-jpa/pom.xml index f7cdfc8..7e134d7 100644 --- a/jdbc/spring-data-jpa/pom.xml +++ b/jdbc/spring-data-jpa/pom.xml @@ -12,7 +12,7 @@ 17 1.9.22 - 1.0.0 + 1.4.0 3.2.1 diff --git a/jdbc/spring-liquibase-app/pom.xml b/jdbc/spring-liquibase-app/pom.xml index b020eb8..33581de 100644 --- a/jdbc/spring-liquibase-app/pom.xml +++ b/jdbc/spring-liquibase-app/pom.xml @@ -14,7 +14,7 @@ 1.9.22 0.9.2 3.2.1 - 0.9.1 + 1.1.0 4.24.0 @@ -50,7 +50,7 @@ tech.ydb.dialects liquibase-ydb-dialect - 0.9.7 + ${liquibase.ydb.dialect.version} org.liquibase