Skip to content

Transactional Outbox Pattern implementation in Kotlin with Spring + PostgreSQL

Notifications You must be signed in to change notification settings

HoucemNaffati/transactional-outbox-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Transactional Outbox Pattern

Example implementation in Kotlin with Spring and PostgreSQL.

About

This repository is created specifically for the purpose of my article about the transactional outbox pattern. You can read it here:

Requirements

  • PostgreSQL >= 9.5
  • schema from schema.sql present in the database

Configuration

Database host, port and credentials in src/main/resources/application.properties

How to run it

Build the app using mvn clean install and then run it using java -jar outbox-0.0.1-SNAPSHOT.jar.

How to use it

The app exposes a single HTTP endpoint POST /accounts. Make a request to it with a request body like:

{
    "name": "Maciej",
    "email": "[email protected]"
}

In up to 5 seconds you should see a log like:

Received event: AccountCreatedEvent(id=996b31e5-c8ad-45c0-97d0-744519b8c454, [email protected])

About

Transactional Outbox Pattern implementation in Kotlin with Spring + PostgreSQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 100.0%