Skip to content
dmitriy-iliyovPublic

Latest commit

 

History

511 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

CodeFactor codecov CI E2E Maven Central javadoc Release GitHub Release Date GitHub last commit


oncebox - Transactional Outbox and Inbox for Spring Boot

Overview

This library provides an implementation of the Transactional Outbox Pattern based on polling events from a relational database and publishing them to a message broker. On the receiving side, an inbox implements the Idempotent Consumer Pattern: it records the ids of consumed events, so a redelivered event is skipped.

The library offers flexible configuration for processing different event types. Each event type is handled independently, and events are processed in parallel using a configurable thread pool, allowing predictable throughput and controlled resource usage.

This approach ensures reliable event publication without relying on database log-based CDC solutions, making it suitable for environments where simplicity, portability, and explicit control over event processing are preferred.

Documentation

The full documentation lives here:

Key Features

  • Atomic persistence - stores events within the same business transaction, ensuring consistency.
  • Adaptive polling - dynamically adjusts the polling interval based on workload to optimize database usage.
  • Flexible polling configuration - allows customization of polling intervals, retry policies, and backoff strategies per event type.
  • At-least-once - guarantees outbox delivery with configurable retries and backoff policies.
  • Effectively-once - optionally records an incoming event in the inbox within the same transaction as its handling, so a redelivered event never changes data twice.
  • At-most-once - optionally records an incoming event in the inbox before handling it, so a side effect such as sending an email is never repeated.
  • Dead Letter Queue - stores events that fail after all retry attempts, with REST API support for management.
  • Background service - handles recovery of stuck events and cleanup of processed or consumed events automatically.
  • Observability - provides out-of-the-box metrics integration via Micrometer.
  • Schema migrations - ships its tables as versioned migrations, applied with Flyway or Liquibase or plain SQL scripts.

Supported Infrastructure

  • Databases: PostgreSQL 16+, MySQL 8.0.13+, Oracle 23+.
  • Schema Migrations: Flyway, Liquibase.
  • Message Brokers: Apache Kafka 3.7+, RabbitMQ 3.12+.
  • Cache Storage (optional for caching): Redis 7+.

Releases

Packages

Used by

Contributors

Languages