Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Implement Microservice pattern: Transactional outbox#3330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
tanya-johari wants to merge5 commits intoiluwatar:master
base:master
Choose a base branch
Loading
fromtanya-johari:feat/tanya-johari/transactional-outbox

Conversation

tanya-johari
Copy link

What does this PR do?

This pull request implements the Transactional Outbox design pattern. It demonstrates how to ensure reliable, at-least-once message delivery from a service by atomically saving business data and its corresponding event in the same database transaction. This PR includes a fully documented code implementation, comprehensive unit tests covering success and failure scenarios, a detailed README and a PlantUML class diagram.

Key features

Customer: The main business entity model that is being created and persisted.

OutboxEvent: The entity representing the message to be sent, which is stored transactionally in the outbox table.

CustomerService: The service that handles the core business logic, responsible for creating the Customer and the OutboxEvent in a single, atomic transaction.

OutboxRepository: The data access layer for reading from and writing OutboxEvent entities to the database.

EventPoller: A background process that periodically scans the outbox table for unprocessed events and publishes them to the message broker.

MessageBroker: A mock implementation that simulates sending the event to an external messaging system.

This pull request is submitted as part of my participation inHacktoberfest 2025

Closes#2671

@github-actionsGitHub Actions
Copy link

github-actionsbot commentedOct 5, 2025
edited
Loading

Analyzing changes in this PR...

This might take a few minutes, please wait

📥 Commits

Analyzing changes from base (ede37bd) to latest commit (d840eea):

Resolves#2671

Resolves#2671

Resolves#2671

Resolves#2671

  • 3e1e516: feat: Implement Transactional Outbox pattern

Resolves#2671

📁 Files being considered (20)

➕ microservices-transactional-outbox/README.md(1 hunk)
➕ microservices-transactional-outbox/etc/microservices-transactional-outbox-flowchart.png(0 hunks)
➕ microservices-transactional-outbox/etc/microservices-transactional-outbox.puml(1 hunk)
➕ microservices-transactional-outbox/pom.xml(1 hunk)
➕ microservices-transactional-outbox/src/main/java/com/iluwatar/transactionaloutbox/App.java(1 hunk)
➕ microservices-transactional-outbox/src/main/java/com/iluwatar/transactionaloutbox/Customer.java(1 hunk)
➕ microservices-transactional-outbox/src/main/java/com/iluwatar/transactionaloutbox/CustomerService.java(1 hunk)
➕ microservices-transactional-outbox/src/main/java/com/iluwatar/transactionaloutbox/EventPoller.java(1 hunk)
➕ microservices-transactional-outbox/src/main/java/com/iluwatar/transactionaloutbox/MessageBroker.java(1 hunk)
➕ microservices-transactional-outbox/src/main/java/com/iluwatar/transactionaloutbox/OutboxEvent.java(1 hunk)
➕ microservices-transactional-outbox/src/main/java/com/iluwatar/transactionaloutbox/OutboxRepository.java(1 hunk)
➕ microservices-transactional-outbox/src/main/resources/META-INF/persistence.xml(1 hunk)
➕ microservices-transactional-outbox/src/test/java/com/iluwatar/transactionaloutbox/AppTest.java(1 hunk)
➕ microservices-transactional-outbox/src/test/java/com/iluwatar/transactionaloutbox/CustomerServiceTests.java(1 hunk)
➕ microservices-transactional-outbox/src/test/java/com/iluwatar/transactionaloutbox/EventPollerTests.java(1 hunk)
➕ microservices-transactional-outbox/src/test/java/com/iluwatar/transactionaloutbox/MessageBrokerTests.java(1 hunk)
➕ microservices-transactional-outbox/src/test/java/com/iluwatar/transactionaloutbox/OutboxEventTests.java(1 hunk)
➕ microservices-transactional-outbox/src/test/java/com/iluwatar/transactionaloutbox/OutboxRepositoryTests.java(1 hunk)
➕ microservices-transactional-outbox/src/test/resources/META-INF/persistence.xml(1 hunk)
🔄 pom.xml(1 hunk)


autogenerated bypresubmit.ai

@sonarqubecloudSonarQubeCloud
Copy link

@tanya-johari
Copy link
Author

Hello@iluwatar the implementation is complete and it's ready for review whenever you have a moment. Please let me know if there are any changes or additional information you need from my side.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Microservice pattern: Transactional outbox
1 participant
@tanya-johari

[8]ページ先頭

©2009-2025 Movatter.jp