Skip to content

Java CI with Maven Spring Boot License

A simple task management framework designed to queue and execute asynchronous tasks with support for database persistence and a user-friendly interface. It can be used to implement scheduling patterns or outbound patterns.

Focus is the usage with spring boot and JPA.

Dashboard

Key Features ✨

  1. JPA-Powered Persistence - Automatically persists tasks to your database
  2. Spring Boot Auto-Configuration - Simple setup with @EnableSpringPersistentTasks
  3. Clustering Support - Built-in lock management for distributed environments
  4. Type-Safe Tasks - Generic task definitions with state objects
  5. Retry Mechanisms - Automatic retry policies for failed executions
  6. Transactional Integration - Works with Spring's transaction management
  7. Queue Management - Intelligent task queuing and prioritization
  8. Different DB Supports - MySQL, azure-sql-edge, PostgreSQL, and H2

Setup with Maven

1
2
3
4
5
<dependency>
    <groupId>org.sterl.spring</groupId>
    <artifactId>spring-persistent-tasks-core</artifactId>
    <version>2.x.x</version>
</dependency>

Setup Spring

1
2
3
@SpringBootApplication
@EnableSpringPersistentTasks
public class ExampleApplication {

Create a Task

1
2
3
4
@Bean
PersistentTask<Vehicle> task1(VehicleHttpConnector vehicleHttpConnector) {
    return v -> vehicleHttpConnector.send(v);
}

Trigger a task

1
2
3
4
5
6
7
@Autowired
PersistentTaskService persistentTaskService;

public void triggerTask1(Vehicle vehicle) {
    persistentTaskService.runOrQueue(
        TriggerBuilder.newTrigger("task1").state(vehicle).build());
}