<dependency>
<groupId>io.arkitik.travako</groupId>
<artifactId>travako-starter-job-bean</artifactId>
<version>${arkitik.travako.version}</version>
</dependency>
internal class SampleJob : JobInstanceBean {
override val trigger = PeriodicTrigger(10_000) // or CronTrigger("*/10 * * * * *")
override val jobKey: String = javaClass.simpleName // should be unique per application, so;
override fun runJob() {
// Do the processing here.
}
}
@Configuration
class SampleJobPortContext {
@Bean
fun sampleJob(): JobInstanceBean = SampleJob()
}
<dependency>
<groupId>io.arkitik.travako</groupId>
<artifactId>travako-starter-processor</artifactId>
<version>${arkitik.travako.version}</version>
</dependency>
arkitik:
travako:
config:
server-key: travako-server
runner-key: travako-runner-1
duplication-processor: false
heartbeat: 5s
jobs-assignee: 1m
jobs-event: 30s
leader-switch: 1h
-
Default Spring
entityManagerFactory
option:<dependency> <groupId>io.arkitik.travako</groupId> <artifactId>travako-starter-spring-jpa-default</artifactId> <version>${arkitik.travako.version}</version> </dependency>
-
Custom Spring
entityManagerFactory
option.<dependency> <groupId>io.arkitik.travako</groupId> <artifactId>travako-starter-spring-jpa-custom</artifactId> <version>${arkitik.travako.version}</version> </dependency>
If you choose the custom Spring entityManagerFactory
, you also need to add the following configuration to your application.yml
:
arkitik:
travako:
database:
datasource:
url: ${database_url:jdbc:mysql://localhost:3307/travako}
username: ${database_user:travako}
password: ${database_password:travako}
driver-class-name: ${database_driverClass:com.mysql.cj.jdbc.Driver}
Add more details about how to use travako service.