ElasticJob-Lite Spring Boot Starter has already integrated TracingConfiguration configuration. What developers need to do is register a bean of DataSource into the Spring IoC Container and set the type of data source. Then the Starter will create an instance of TracingConfiguration and register it into the container.

Import Maven Dependency

Import spring-boot-starter-jdbc for DataSource register or create a bean of DataSource manually.

  1. <dependency>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-starter-jdbc</artifactId>
  4. <version>${springboot.version}</version>
  5. </dependency>

Configuration

  1. spring:
  2. datasource:
  3. url: jdbc:h2:mem:job_event_storage
  4. driver-class-name: org.h2.Driver
  5. username: sa
  6. password:
  7. elasticjob:
  8. tracing:
  9. type: RDB

Job Start

TracingConfiguration will be registered into the IoC container imperceptibly after setting tracing type to RDB. If elasticjob-lite-spring-boot-starter was imported, developers need to do nothing else. The instances of JobBootstrap will use the TracingConfiguration automatically.