feat: Quarkus support for the Process Engine Worker (#265) - #268
Draft
Hafflgav wants to merge 1 commit into
Draft
Conversation
Extract a framework-independent core, keep the Spring Boot starter backward compatible and add a Quarkus extension with build-time worker discovery. Modules: - process-engine-worker-core: annotations (without Spring @aliasfor, alias semantics preserved), ProcessEngineWorkerRegistrar, parameter/result resolution, exception handling, metrics and idempotency logic plus the SPIs TransactionalExecutor, AfterCommitHook and TransactionalMethodDetector. - process-engine-worker-spring-boot-starter: thin Spring layer over the core (same class names, constructor, auto-configuration imports and properties). - process-engine-worker-idempotency-registry-jpa: framework-free JPA registry (entity and converter moved with unchanged FQCNs and schema, EntityManager based registry, pluggable Java/Jackson result serialization), used by the Spring JPA module and the Quarkus extension. - process-engine-worker-quarkus(-deployment): Quarkus extension (runtime in Kotlin, deployment in Java) with Jandex discovery of @ProcessEngineWorker methods, auto @singleton worker beans, registration at runtime init before StartupEvent, build-time validation, JTA transactions (narayana), Micrometer metrics and JPA idempotency as optional integrations, native image reflection registration and @DefaultBean producers for customization. Documentation: README with framework matrix, framework-neutral reference, new Spring Boot and Quarkus pages, updated idempotency and deployment pages. Tests: core unit tests, Spring proxy/transaction tests, Hibernate/H2 tests of the JPA module, Quarkus extension tests (QuarkusExtensionTest) and the existing Spring integration tests (failsafe now also runs the nested IdempotencyITest variants; waits widened to tolerate the external task client backoff). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #265
Summary
Extracts a framework-independent core from the Spring Boot starter, keeps the starter backward compatible and adds a Quarkus extension with build-time worker discovery. JPA-based idempotency is now available for both frameworks.
Module layout
core/process-engine-worker-coreProcessEngineWorkerRegistrar, resolvers, exceptions, metrics, idempotency logic, SPIsTransactionalExecutor/AfterCommitHook/TransactionalMethodDetectorspring-boot-starter/process-engine-worker-spring-boot-starter.importsand propertiesidempotency-registry-jpa/process-engine-worker-idempotency-registry-jpaEntityManagerJpaIdempotencyRegistry, pluggable Java/Jackson serializer)spring-boot-idempotency-registry-jpa/quarkus/runtime+quarkus/deploymentprocess-engine-worker-quarkus(+-deployment)Quarkus extension
@ProcessEngineWorkermethods; worker classes need no scope annotation (auto@Singleton, unremovable).RUNTIME_INITrecorder step (ServiceStartBuildItem), i.e. before anyStartupEventobserver and therefore before the C8 Quarkus adapter subscribes its job workers.@Produces, duplicate topics (per tenant), Kotlin dual constructors, vetoed classes,topic/valueconflicts.quarkus-narayana-jta), Micrometer metrics, JPA idempotency (quarkus-hibernate-orm+ the JPA module).@DefaultBeans, replaceable by a user@Produces.dev.bpm-crafters.process-api.worker.{enabled,complete-tasks-before-commit,remove-task-result-on-completion,tenant-id}.@Variabletypes and converters are registered for reflection.Compatibility (Spring Boot)
No source changes required for existing projects (
examples/anditest/build unchanged). Documented deltas:@AliasForremoved from@ProcessEngineWorker/@Variable;topic/valueandname/valuealias semantics are reproduced by the core.ProcessEngineStarterRegistrar.TaskHandlerWithResult/FailureRetrymoved toProcessEngineWorkerRegistrar(core).registerProcessWorkersdeprecated (it was never evaluated;enabledis the switch).Documentation
README reworked (framework matrix, Quarkus sample, links),
docs/process-engine-worker.mdframework-neutral with corrected configuration, newdocs/spring-boot.mdanddocs/quarkus.md, updateddocs/idempotency.mdanddocs/process-deployment.md.Out of scope / follow-ups
process-engine-adapter-camunda-platform-c8-quarkusis released.Test plan
./mvnw clean verify -T4(CI command): all modules green, 167 tests (core 67, Spring 11, JPA 16, Quarkus runtime 14, Quarkus deployment 42, Spring itests 17 against Camunda 7 + Postgres via Testcontainers)-Preleasepackaging: sources + javadoc jars for all new modules, extension descriptor validation passesIdempotencyITestvariants (previously never executed); registrar itests wait up to 60s to tolerate the external task client backoff under parallel load🤖 Generated with Claude Code