Skip to content

Conversation

@magro
Copy link
Contributor

@magro magro commented Aug 28, 2025

In one project we're using Quarkus, where the transactional-outbox would be useful as well. For this I added a Quarkus extension (see e.g. this guide) that makes the transactional-outbox available for Quarkus applications. The main README is only slightly extended, full documentation for the Quarkus extension is in the runtime module of the extension.

@github-actions
Copy link

github-actions bot commented Aug 28, 2025

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ EDITORCONFIG editorconfig-checker 68 0 0.15s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

This comment was marked as outdated.

@magro magro requested a review from danielrehmann August 28, 2025 22:43
@magro magro force-pushed the quarkus-extension-2 branch from c19aad4 to 21cd20a Compare August 28, 2025 22:48
@magro magro requested a review from Copilot August 28, 2025 22:49
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

The purpose of this PR is to add a Quarkus extension for the transactional-outbox library, enabling its use within Quarkus applications. This extends the library's reach beyond Spring applications to include the Quarkus ecosystem.

Key changes:

  • Added outbox-kafka-quarkus and outbox-kafka-quarkus-deployment modules to the project
  • Implemented complete outbox pattern with Kafka publishing functionality using Quarkus-specific infrastructure
  • Included comprehensive test coverage for all core features including tracing, locking, and message publishing

Reviewed Changes

Copilot reviewed 65 out of 66 changed files in this pull request and generated 5 comments.

File Description
settings.gradle.kts Added new Quarkus extension modules to the build
outbox-kafka-quarkus/src/test/resources/* Database migration scripts and test configuration
outbox-kafka-quarkus/src/test/java/* Comprehensive test suite covering all functionality
outbox-kafka-quarkus/src/main/java/* Core implementation including services, repositories, publishers, and tracing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

magro added 6 commits August 29, 2025 01:00
The outbox-kafka-quarkus module contains runtime functionality, the
deployment module the required build steps for quarkus. The deployment
module duplicates a few test related things from the runtime module to
keep the build simple - in general we rather copy things than making
the build more complicated.

The runtime module uses the quarkus plugin for tests so that we get
quarkus test support and are able to run integration tests. Apart from
that the runtime module shall just be built via the quarkus extension
plugin together with the deployment module.

The root gradle build file contains some exceptions for plugins that are
needed to make it work, e.g. because the protobuf plugin does not work
with quarkus (and we're not using protobuf in the quarkus module - for
now we assume it's not needed, can be added on request).

Some functionality like trace propagation still needs to be added, also
documentation is not yet there.
Similarly as it was added with PR #334 to the spring module
This is very similar to the solution implemented with PR #494 (in commit
d1d3834) for spring classic, only that it's using opentelemetry, which
is the default tracing solution for quarkus.

What does the solution provide:
* Adds a span for the message in the transactional-outbox (with start
  timestamp set to the time when the outbox record was created, and end
  timestamp set to the time when it's processed and sent to Kafka)
* Adds another span for the sending the message to Kafka (start
  timestamp is the time when the `ProducerRecord` is created, end
  timestamp is set when message sending got confirmed)
* Add tracing headers to the Kafka message, which can be extracted via
  `Propagator.extract` on consumer side.

When opentelemetry is on the classpath, context propagation should be
active, otherwise there's no tracing context propagation.
The main readme is only slightly adjusted, so that it does not get too
long. Quarkus specific docs are added to the quarkus runtime module.
Applications might use InMemory Channels in tests, which then requires
support by transactional-outbox to test event driven processes. For this
the abstraction of `MessagePublisher` is introduced, to allow a
`KafkaProducer` backed implementation and an `Emitter` based
implementation (which can then be configured to be an in-memory
connector based emitter).
@magro magro force-pushed the quarkus-extension-2 branch from 21cd20a to e149db3 Compare August 28, 2025 23:00
@magro magro force-pushed the quarkus-extension-2 branch from e2a5a99 to 950fd50 Compare September 3, 2025 21:38
Copy link
Collaborator

@thoreottenheym thoreottenheym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition of an extension which now supports quarkus! I like the addition of the health check as well as the ability to choose between smallRye emitters and kafka producers. I have no change request since most of the classes are very similar to the already existing implementations. I have to say though, that due to tight capacities on our end i was also not able to invest a lot of time and my knowledge of this project is not yet great, so take this review with a grain of salt :D

@magro
Copy link
Contributor Author

magro commented Dec 9, 2025

@thoreottenheym thanks for your review btw, I somehow completely missed that 🙈

@FynnMcKracken
Copy link
Collaborator

@magro please be aware that we recently upgraded to Spring 7 / Spring Boot 4 and will no longer maintain Spring 6 / Spring Boot 3, i.e. your changes with the next release will only be Spring Boot 4 compatible 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants