Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Changelog

## v2.3.1 - (wip)

### UI Improvements:

- Modernized UI with improved Bootstrap 5 styling
- Redesigned scheduler status cards with cleaner layout
- Updated task execution statistics with card-based design
- Improved trigger views with better responsive design
- Enhanced trigger history display with modern card layout
- Added dark mode support
- User-toggleable dark/light theme with localStorage persistence
- Proper semantic color classes for theme compatibility
- Toggle button with sun/moon icons in navbar
- Documentation improvements
- Fixed navigation structure with tree-based sub-pages
- Restored content navigation to page layout
- Moved tags page to bottom of navigation
- Added robots.txt and SEO improvements
- Added React component tests
- Simple render tests for all views and pages
- Test coverage for scheduler, trigger, and history components

## v2.3.0 - (2025-10-5)

- added the ability to add custom serialization
Expand Down
88 changes: 83 additions & 5 deletions doc/README.MD
Original file line number Diff line number Diff line change
@@ -1,8 +1,86 @@
# Spring Persistent Tasks Documentation

This directory contains the MkDocs-based documentation for Spring Persistent Tasks.

## Setup

### Prerequisites
- Python 3.7 or higher
- pip (Python package manager)

### Installation

```bash
pip install -r requirements.txt
```

## Commands

- `pip install -r requirements.txt` - update
- `mkdocs serve` - Start the live-reloading docs server.
- `mkdocs build` - Build the documentation site.
- `mkdocs -h` - Print help message and exit.
### Development
- `mkdocs serve` - Start the live-reloading docs server at http://127.0.0.1:8000
- `mkdocs serve --dirtyreload` - Faster reload during development

**Windows alternative** (if mkdocs not in PATH):
```bash
python -m mkdocs serve
python -m mkdocs serve --dirtyreload
```

### Build
- `mkdocs build` - Build the documentation site to `site/` directory
- `mkdocs build --clean` - Build with clean output directory

**Windows alternative** (if mkdocs not in PATH):
```bash
python -m mkdocs build
python -m mkdocs build --clean
```

### Maintenance
- `pip install --upgrade -r requirements.txt` - Update dependencies
- `mkdocs -h` - Print help message and exit

**Windows alternative** (if mkdocs not in PATH):
```bash
python -m pip install --upgrade -r requirements.txt
python -m mkdocs serve
```

## Documentation Structure

```
docs/
├── index.md # Home page
├── register-spring-task.md # Task registration guide
├── queue-a-spring-task.md # Task queuing guide
├── delete-task-trigger.md # Task cancellation
├── life-cycle-events.md # Event handling
├── failed-spring-triggers.md # Error handling
├── transaction-management.md # Transaction configuration
├── setup/ # Setup guides
│ ├── maven-setup.md
│ ├── liquibase-setup.md
│ ├── spring-configuration-options.md
│ └── ...
└── test/ # Testing guides
└── junit-test.md
```

## SEO Optimization

The documentation includes comprehensive SEO optimization:

- **Meta Tags**: Each page includes title, description, and keywords
- **Structured Tags**: Pages are tagged for better categorization
- **Site Configuration**: sitemap.xml, robots.txt support via MkDocs
- **Search Optimization**: Enhanced search with separators and language support
- **Minification**: HTML, CSS, and JS minification for faster loading

## Publishing

The documentation is published to: https://spring-persistent-task.sterl.org

- `pip install --upgrade -r requirements.txt` update
To publish changes:
```bash
./publish.sh
```
10 changes: 10 additions & 0 deletions doc/docs/delete-task-trigger.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
---
title: Cancel and Delete Triggers
description: Learn how to cancel queued triggers, stop running tasks, and handle task failures with CancelTaskException and FailTaskNoRetryException.
keywords: cancel trigger, delete task, stop task, task cancellation, fail task, cancel running task
tags:
- Task Cancellation
- Error Handling
- Task Management
---

# Cancel a trigger

## Cancel a queued trigger
Expand Down
11 changes: 11 additions & 0 deletions doc/docs/failed-spring-triggers.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
---
title: Handle Failed Triggers
description: Learn how to react to trigger failures using callbacks and life cycle events with TriggerFailedEvent and TriggerExpiredEvent in Spring Persistent Tasks.
keywords: failed trigger, error handling, trigger failure callback, TriggerFailedEvent, task error handling, retry failure
tags:
- Error Handling
- Failure Callback
- Events
- Retry Logic
---

# Reacting to Trigger Failures

## Use callback since v2.2.0
Expand Down
19 changes: 17 additions & 2 deletions doc/docs/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
---
title: Spring Persistent Tasks - Async Task Management Framework
description: A lightweight task management framework for Spring Boot with JPA persistence, clustering support, retry mechanisms, and transactional integration for asynchronous task execution.
keywords: spring boot, task scheduler, async tasks, JPA persistence, distributed tasks, task queue, retry mechanism, spring framework, task management, background jobs
tags:
- Spring Boot
- Task Scheduler
- Async Processing
- JPA
- Clustering
- Retry Logic
---

# Spring Persistent Tasks

[![Java CI with Maven](https://github.com/sterlp/spring-persistent-tasks/actions/workflows/build.yml/badge.svg)](https://github.com/sterlp/spring-persistent-tasks/actions/workflows/build.yml)
[![Spring Boot](https://img.shields.io/badge/Spring%20Boot-3.x-brightgreen.svg)](https://spring.io/projects/spring-boot)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](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.
A lightweight and simple task management framework for **Spring Boot** designed to queue and execute **asynchronous tasks** with support for **database persistence** and a user-friendly interface. Perfect for implementing scheduling patterns, outbound patterns, and background job processing in distributed systems.

Focus is the usage with spring boot and JPA.
**Built for Spring Boot 3.x with JPA** - seamlessly integrates with your existing Spring application.

![Dashboard](/assets/dashboard.png)

Expand Down
11 changes: 11 additions & 0 deletions doc/docs/life-cycle-events.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
---
title: Trigger Life Cycle Events
description: Learn about trigger life cycle events in Spring Persistent Tasks including TriggerAddedEvent, TriggerRunningEvent, TriggerSuccessEvent, TriggerFailedEvent, and TriggerCanceledEvent.
keywords: trigger events, life cycle events, spring event listener, trigger states, task monitoring, event driven tasks
tags:
- Life Cycle
- Events
- Monitoring
- Event Listener
---

# Trigger Life Cycle Events

Any trigger follows a particular life cycle having the status:
Expand Down
13 changes: 12 additions & 1 deletion doc/docs/queue-a-spring-task.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
---
title: Queue and Execute Tasks
description: Learn how to queue tasks for later execution or run them immediately using TriggerService and PersistentTaskService with Spring application events.
keywords: queue task, trigger task, task execution, spring events, task scheduling, deferred execution, immediate execution
tags:
- Task Queue
- Task Execution
- TriggerService
- Spring Events
---

# Queue a task execution

You can queue a task or a later execution or request the executer to run a task directly, if a free thread is available on the node.
You can queue a task for later execution or request the executor to run a task directly if a free thread is available on the node.

## Direct usage of the `TriggerService` or `PersistentTaskService`.

Expand Down
13 changes: 12 additions & 1 deletion doc/docs/register-spring-task.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
---
title: Register and Define Spring Tasks
description: Learn how to register and define persistent tasks in Spring Boot using beans, closures, and transactional tasks with retry strategies.
keywords: spring task registration, persistent task definition, transactional task, spring bean task, task retry strategy, spring boot tasks
tags:
- Task Definition
- Spring Bean
- Transactional Task
- Retry Strategy
---

# Register a Tasks

![Spring Persistent Task Interface](/assets/spring-persistent-task-interface.png)

## RunningTriggerContextHolder @since v1.6

Allows the access to the state object and gives more informations about the current executed trigger.
Allows the access to the state object and gives more information about the currently executed trigger.

# Simple Closure

Expand Down
14 changes: 14 additions & 0 deletions doc/docs/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# robots.txt for Spring Persistent Tasks Documentation
# Allow all search engines to crawl the documentation

User-agent: *
Allow: /

# Sitemap location
Sitemap: https://spring-persistent-task.sterl.org/sitemap.xml

# Optimize crawl budget
Crawl-delay: 0

# Block common bot traps (if any)
# Disallow: /404.html
11 changes: 11 additions & 0 deletions doc/docs/setup/maven-setup.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
---
title: Maven Setup and Dependencies
description: Complete guide to setting up Spring Persistent Tasks with Maven including core, UI, and database dependencies configuration.
keywords: maven setup, spring persistent tasks maven, maven dependency, spring boot setup, liquibase setup, EnableSpringPersistentTasks
tags:
- Setup
- Maven
- Configuration
- Installation
---

# Maven setup

- [Maven Central spring-persistent-tasks-core](https://central.sonatype.com/artifact/org.sterl.spring/spring-persistent-tasks-core/versions)
Expand Down
10 changes: 10 additions & 0 deletions doc/docs/test/junit-test.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
---
title: JUnit Testing for Tasks and Triggers
description: Comprehensive guide to testing Spring Persistent Tasks with JUnit including disabling scheduler, manual trigger execution, and async testing strategies.
keywords: junit testing, spring task testing, trigger testing, test scheduler, async testing, integration testing
tags:
- Testing
- JUnit
- Integration Tests
---

# JUnit Tests Triggers and Tasks

## Disable SchedulerService
Expand Down
12 changes: 11 additions & 1 deletion doc/docs/transaction-management.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
---
title: Transaction Management
description: Learn how to manage transactions in Spring Persistent Tasks using transactional flags, @Transactional annotation, and TransactionTemplate configuration.
keywords: spring transaction, transactional task, transaction management, spring @Transactional, TransactionTemplate, task transaction
tags:
- Transactions
- Configuration
- Spring Framework
---

# Transaction Management

Overall the framework assumes that the queued task is not transactional nor a transaction is needed. To wrap the trigger status updates together with any transactional workload (recommended) where are two possibilites:
Overall the framework assumes that the queued task is not transactional nor a transaction is needed. To wrap the trigger status updates together with any transactional workload (recommended) there are two possibilities:

1. Use the transactional flag
1. Use the Spring `@Transactional` annotation
Expand Down
60 changes: 54 additions & 6 deletions doc/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,57 @@
site_name: Spring Persistent Tasks
site_url: https://spring-persistent-task.sterl.org
site_description: A lightweight task management framework for Spring Boot with JPA persistence, clustering support, and retry mechanisms for asynchronous task execution
site_author: Paul Sterl
use_directory_urls: false

# SEO and Social Media
extra:
social:
- icon: fontawesome/brands/github
link: https://github.com/sterlp/spring-persistent-tasks
analytics:
provider: google
property: !ENV GOOGLE_ANALYTICS_KEY
generator: false

theme:
name: material
language: en
palette:
- scheme: default
toggle:
icon: material/brightness-7
name: Switch to dark mode
- scheme: slate
toggle:
icon: material/brightness-4
name: Switch to light mode
features:
- content.code.copy
- content.code.annotate
- navigation.indexes
- navigation.path
- navigation.prune
- navigation.expand
- navigation.top
- search.suggest
- search.highlight
- toc.follow

plugins:
- search
- tags
- search:
lang: en
separator: '[\s\-\.]+'
- tags:
tags_file: tags.md
- glightbox
- awesome-nav
- awesome-pages
- minify:
minify_html: true
minify_js: true
minify_css: true
htmlmin_opts:
remove_comments: true

markdown_extensions:
- attr_list
Expand All @@ -31,6 +67,18 @@ markdown_extensions:
- pymdownx.superfences
- admonition
- pymdownx.details
- pymdownx.superfences
- toc
repo_url: https://github.com/sterlp/spring-persistent-tasks
- toc:
permalink: true
title: On this page
- pymdownx.tabbed:
alternate_style: true
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg

repo_url: https://github.com/sterlp/spring-persistent-tasks
repo_name: sterlp/spring-persistent-tasks
edit_uri: edit/main/doc/docs/

# Copyright
copyright: Copyright © 2024 Paul Sterl - Licensed under MIT License
3 changes: 2 additions & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mkdocs-material
mkdocs-glightbox
mkdocs-awesome-pages-plugin
mkdocs-awesome-pages-plugin
mkdocs-minify-plugin
2 changes: 1 addition & 1 deletion example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<!--
<spt.version>2.1.2</spt.version>
-->
<spt.version>2.2.5-SNAPSHOT</spt.version>
<spt.version>2.3.1-SNAPSHOT</spt.version>
</properties>

<dependencies>
Expand Down
Loading