├── .all-contributorsrc ├── .github ├── CODEOWNERS ├── dependabot.yml ├── project.yml └── workflows │ ├── build.yml │ ├── pre-release.yml │ ├── quarkus-snapshot.yaml │ ├── release-perform.yml │ └── release-prepare.yml ├── .gitignore ├── LICENSE ├── README.md ├── deployment ├── pom.xml └── src │ ├── main │ ├── java │ │ └── io │ │ │ └── quarkiverse │ │ │ └── zeebe │ │ │ ├── JobWorkerMethodItem.java │ │ │ ├── ZeebeDevProcessor.java │ │ │ ├── ZeebeDevServiceBuildTimeConfig.java │ │ │ ├── ZeebeDotNames.java │ │ │ ├── ZeebeProcessor.java │ │ │ ├── ZeebeResourcesBuildItem.java │ │ │ ├── ZeebeWorkersBuildItem.java │ │ │ └── devservices │ │ │ ├── ContainerShutdownCloseable.java │ │ │ ├── DevUIZeebeProcessor.java │ │ │ ├── ZeebeDevServiceProcessor.java │ │ │ ├── ZeebeDevServicesConfig.java │ │ │ └── ZeebeDevServicesProviderBuildItem.java │ └── resources │ │ └── dev-ui │ │ ├── qwc-zeebe-dashboard.js │ │ └── zeebe │ │ ├── bpmnjs │ │ ├── bpmn-navigated-viewer.development.js │ │ └── zeebe-bpmn-diagram.js │ │ ├── components │ │ ├── zeebe-incident-details-dialog.js │ │ ├── zeebe-incident-resolve-dialog.js │ │ ├── zeebe-instance-cancel-dialog.js │ │ ├── zeebe-instance-create-dialog.js │ │ ├── zeebe-job-complete-dialog.js │ │ ├── zeebe-job-fail-dialog.js │ │ ├── zeebe-job-retries-dialog.js │ │ ├── zeebe-job-throw-error-dialog.js │ │ ├── zeebe-process-deploy-dialog.js │ │ ├── zeebe-send-message-dialog.js │ │ ├── zeebe-send-signal-dialog.js │ │ ├── zeebe-table.js │ │ ├── zeebe-user-task-complete-dialog.js │ │ ├── zeebe-user-task-info-dialog.js │ │ ├── zeebe-utils.js │ │ ├── zeebe-variable-create-dialog.js │ │ ├── zeebe-variable-edit-dialog.js │ │ └── zeebe-variable-history-dialog.js │ │ ├── zeebe-errors.js │ │ ├── zeebe-incidents.js │ │ ├── zeebe-instance.js │ │ ├── zeebe-instances.js │ │ ├── zeebe-jobs.js │ │ ├── zeebe-messages.js │ │ ├── zeebe-process.js │ │ ├── zeebe-processes.js │ │ ├── zeebe-signals.js │ │ └── zeebe-user-tasks.js │ └── test │ ├── java │ └── io │ │ └── quarkiverse │ │ └── zeebe │ │ ├── CustomJsonMapperTest.java │ │ ├── ZeebeClientConnectionTest.java │ │ ├── ZeebeProcessTest.java │ │ ├── jobworker │ │ ├── Parameter.java │ │ └── TestJobWorker.java │ │ └── test │ │ ├── CustomJsonMapperProducer.java │ │ ├── Param.java │ │ └── TestService.java │ └── resources │ ├── bpmn │ └── TestProcess.bpmn │ ├── default.properties │ └── no-resources.properties ├── docs ├── antora.yml ├── images │ ├── devservice.svg │ ├── devui.png │ ├── diagrams.excalidraw │ ├── opentelemetry.png │ └── testing.svg ├── modules │ └── ROOT │ │ ├── assets │ │ └── images │ │ │ ├── .keepme │ │ │ ├── devservice.svg │ │ │ ├── devui.png │ │ │ ├── diagrams.excalidraw │ │ │ ├── opentelemetry.png │ │ │ └── testing.svg │ │ ├── examples │ │ └── .keepme │ │ ├── nav.adoc │ │ └── pages │ │ ├── includes │ │ ├── attributes.adoc │ │ ├── quarkus-zeebe.adoc │ │ └── quarkus-zeebe_quarkus.zeebe.adoc │ │ └── index.adoc ├── pom.xml └── templates │ └── includes │ └── attributes.adoc ├── examples ├── base │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── io │ │ │ └── quarkiverse │ │ │ └── zeebe │ │ │ └── examples │ │ │ └── base │ │ │ ├── Parameter.java │ │ │ ├── ProcessRestController.java │ │ │ ├── TestJobWorker.java │ │ │ └── TestService.java │ │ └── resources │ │ ├── application.properties │ │ └── bpmn │ │ ├── diagram_1.bpmn │ │ ├── simple.bpmn │ │ ├── simple_call.bpmn │ │ ├── simple_escalation.bpmn │ │ ├── simple_message.bpmn │ │ ├── simple_process.bpmn │ │ ├── simple_signal.bpmn │ │ ├── simple_start_signal.bpmn │ │ ├── simple_task.bpmn │ │ ├── simple_task2.bpmn │ │ ├── simple_timer.bpmn │ │ ├── simple_user_task.bpmn │ │ ├── start_message.bpmn │ │ ├── start_timer.bpmn │ │ ├── test_complete.bpmn │ │ ├── test_exception.bpmn │ │ ├── test_fail.bpmn │ │ └── test_throw.bpmn ├── opentelemetry │ ├── README.md │ ├── docker-compose.yml │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── io │ │ │ └── quarkiverse │ │ │ └── zeebe │ │ │ └── examples │ │ │ └── opentelemetry │ │ │ ├── Parameter.java │ │ │ ├── ProcessRestController.java │ │ │ ├── TestJobWorker.java │ │ │ └── TestService.java │ │ └── resources │ │ ├── application.properties │ │ └── bpmn │ │ ├── open-telemetry.bpmn │ │ ├── test_complete.bpmn │ │ ├── test_exception.bpmn │ │ ├── test_fail.bpmn │ │ └── test_throw.bpmn ├── pom.xml └── reactive │ ├── README.md │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── io │ │ │ └── quarkiverse │ │ │ └── zeebe │ │ │ └── examples │ │ │ └── reactive │ │ │ ├── JobCounter.java │ │ │ ├── Parameter.java │ │ │ ├── ParametersJobWorker.java │ │ │ ├── TestJobWorker.java │ │ │ ├── TestRestClient.java │ │ │ └── TestRestController.java │ └── resources │ │ ├── application.properties │ │ └── bpmn │ │ ├── blocking-auto.bpmn │ │ ├── blocking.bpmn │ │ ├── completionStage-auto.bpmn │ │ ├── param.bpmn │ │ ├── test-process.bpmn │ │ └── uni-auto.bpmn │ └── test │ └── resources │ ├── mockserver.properties │ └── mockserver │ └── test.json ├── integration-tests ├── bpmn │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── io │ │ │ │ └── quarkiverse │ │ │ │ └── zeebe │ │ │ │ └── it │ │ │ │ └── bpmn │ │ │ │ ├── TestClientInterceptor.java │ │ │ │ ├── errors │ │ │ │ └── ErrorsJobWorker.java │ │ │ │ ├── gateway │ │ │ │ ├── GatewayJobWorker.java │ │ │ │ ├── Input.java │ │ │ │ └── Parameter.java │ │ │ │ ├── metrics │ │ │ │ ├── MetricsTestJobWorker.java │ │ │ │ └── MetricsTestParameter.java │ │ │ │ ├── parameters │ │ │ │ ├── Parameter.java │ │ │ │ └── ParameterJobWorker.java │ │ │ │ └── sayhello │ │ │ │ ├── SayHelloBusinessService.java │ │ │ │ ├── SayHelloJobWorker.java │ │ │ │ ├── SayHelloParameter.java │ │ │ │ └── SayHelloRestController.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── bpmn │ │ │ ├── errors │ │ │ ├── fail.bpmn │ │ │ ├── throw-runtime-exception.bpmn │ │ │ ├── throw-zeebe-error-event.bpmn │ │ │ └── throw-zeebe-error.bpmn │ │ │ ├── gateway.bpmn │ │ │ ├── ht.bpmn │ │ │ ├── metrics_test.bpmn │ │ │ ├── parameters.bpmn │ │ │ └── say_hello.bpmn │ │ └── test │ │ └── java │ │ └── io │ │ └── quarkiverse │ │ └── zeebe │ │ └── it │ │ └── bpmn │ │ ├── AbstractTest.java │ │ ├── errors │ │ ├── ErrorsIT.java │ │ └── ErrorsTest.java │ │ ├── gateway │ │ ├── GatewayIT.java │ │ └── GatewayTest.java │ │ ├── health │ │ ├── HealthCheckIT.java │ │ └── HealthCheckTest.java │ │ ├── metrics │ │ ├── MetricsIT.java │ │ └── MetricsTest.java │ │ ├── parameters │ │ ├── ParametersIT.java │ │ └── ParametersTest.java │ │ └── sayhello │ │ ├── SayHelloIT.java │ │ └── SayHelloTest.java ├── docker │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── docker │ │ │ ├── Dockerfile.jvm │ │ │ └── Dockerfile.native │ │ ├── java │ │ │ └── io │ │ │ │ └── quarkiverse │ │ │ │ └── zeebe │ │ │ │ └── it │ │ │ │ └── docker │ │ │ │ └── sayhello │ │ │ │ ├── SayHelloJobWorker.java │ │ │ │ └── SayHelloParameter.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── bpmn │ │ │ └── say_hello.bpmn │ │ └── test │ │ └── java │ │ └── io │ │ └── quarkiverse │ │ └── zeebe │ │ └── it │ │ └── docker │ │ ├── AbstractTest.java │ │ └── sayhello │ │ ├── SayHelloIT.java │ │ └── SayHelloTest.java ├── embedded │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── io │ │ │ │ └── quarkiverse │ │ │ │ └── zeebe │ │ │ │ └── it │ │ │ │ └── embedded │ │ │ │ ├── SayHelloBusinessService.java │ │ │ │ ├── SayHelloJobWorker.java │ │ │ │ └── SayHelloParameter.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── bpmn │ │ │ └── say_hello.bpmn │ │ └── test │ │ └── java │ │ └── io │ │ └── quarkiverse │ │ └── zeebe │ │ └── it │ │ └── embedded │ │ ├── SayHelloEmbeddedIT.java │ │ └── SayHelloEmbeddedTest.java ├── noop │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── io │ │ │ │ └── quarkiverse │ │ │ │ └── zeebe │ │ │ │ └── it │ │ │ │ └── bpmn │ │ │ │ ├── TestClientInterceptor.java │ │ │ │ └── sayhello │ │ │ │ ├── SayHelloBusinessService.java │ │ │ │ ├── SayHelloJobWorker.java │ │ │ │ ├── SayHelloParameter.java │ │ │ │ └── SayHelloRestController.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── bpmn │ │ │ └── say_hello.bpmn │ │ └── test │ │ └── java │ │ └── io │ │ └── quarkiverse │ │ └── zeebe │ │ └── it │ │ └── bpmn │ │ ├── AbstractTest.java │ │ └── sayhello │ │ ├── SayHelloIT.java │ │ └── SayHelloTest.java ├── opentelemetry │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── io │ │ │ │ └── quarkiverse │ │ │ │ └── zeebe │ │ │ │ └── it │ │ │ │ └── opentelemetry │ │ │ │ ├── OpentelemetryTestJobWorker.java │ │ │ │ └── Parameter.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── bpmn │ │ │ └── test.bpmn │ │ └── test │ │ └── java │ │ └── io │ │ └── quarkiverse │ │ └── zeebe │ │ └── it │ │ └── opentelemetry │ │ ├── OpentelemetryIT.java │ │ ├── OpentelemetryTest.java │ │ └── TestResources.java ├── panache │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── io │ │ │ │ └── quarkiverse │ │ │ │ └── zeebe │ │ │ │ └── examples │ │ │ │ └── panache │ │ │ │ ├── CustomJsonMapper.java │ │ │ │ ├── Person.java │ │ │ │ ├── PersonJobWorker.java │ │ │ │ ├── PersonRepository.java │ │ │ │ └── PersonRestController.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── bpmn │ │ │ └── person-process.bpmn │ │ └── test │ │ └── java │ │ └── io │ │ └── quarkiverse │ │ └── zeebe │ │ └── examples │ │ └── panache │ │ ├── PersonIT.java │ │ └── PersonTest.java └── pom.xml ├── pom.xml ├── runtime ├── pom.xml └── src │ └── main │ ├── java │ └── io │ │ └── quarkiverse │ │ └── zeebe │ │ ├── CustomHeader.java │ │ ├── CustomHeaders.java │ │ ├── JobWorker.java │ │ ├── JobWorkerExceptionHandler.java │ │ ├── Variable.java │ │ ├── VariablesAsType.java │ │ ├── ZeebeBpmnError.java │ │ ├── ZeebeClientInterceptor.java │ │ ├── ZeebeResourcesProducer.java │ │ ├── ZeebeScheduledExecutorService.java │ │ └── runtime │ │ ├── DefaultJobWorkerExceptionHandler.java │ │ ├── JobWorkerCommand.java │ │ ├── JobWorkerHandler.java │ │ ├── JobWorkerInvoker.java │ │ ├── JobWorkerMetadata.java │ │ ├── JobWorkerValue.java │ │ ├── ZeebeBuildTimeConfig.java │ │ ├── ZeebeClientBuilderFactory.java │ │ ├── ZeebeClientRuntimeConfig.java │ │ ├── ZeebeClientService.java │ │ ├── ZeebeLifecycleManager.java │ │ ├── ZeebeRecorder.java │ │ ├── ZeebeRuntimeConfig.java │ │ ├── devmode │ │ ├── JobWorkerHotReplacementSetup.java │ │ ├── JobWorkerReplacementInterceptor.java │ │ ├── ZeebeJsonRPCService.java │ │ ├── ZeebeRecordsHandler.java │ │ └── store │ │ │ ├── BpmnModel.java │ │ │ ├── RecordStore.java │ │ │ ├── RecordStoreItem.java │ │ │ ├── Store.java │ │ │ └── UserTaskHeaders.java │ │ ├── graal │ │ └── ConscryptSubstitutions.java │ │ ├── health │ │ ├── ZeebeHealthCheck.java │ │ └── ZeebeTopologyHealthCheck.java │ │ ├── metrics │ │ ├── MetricsRecorder.java │ │ ├── MicrometerMetricsRecorder.java │ │ └── NoopMetricsRecorder.java │ │ ├── noop │ │ ├── AbstractStep.java │ │ ├── ActivateJobsCommandStep1Impl.java │ │ ├── AssignUserTaskCommandStep1Impl.java │ │ ├── BroadcastSignalCommandStep1Impl.java │ │ ├── CancelProcessInstanceCommandStep1Impl.java │ │ ├── CompleteJobCommandStep1Impl.java │ │ ├── CompleteUserTaskCommandStep1Impl.java │ │ ├── CreateProcessInstanceCommandStep1Impl.java │ │ ├── DeleteResourceCommandStep1Impl.java │ │ ├── DeployResourceCommandStep1Impl.java │ │ ├── EvaluateDecisionCommandStep1Impl.java │ │ ├── FailJobCommandStep1Impl.java │ │ ├── FinalCommandStepImpl.java │ │ ├── JobWorkerBuilderStep1Impl.java │ │ ├── MigrateProcessInstanceCommandStep1Impl.java │ │ ├── ModifyProcessInstanceCommandStep1Impl.java │ │ ├── NoOpZeebeClient.java │ │ ├── PublishMessageCommandStep1Impl.java │ │ ├── ResolveIncidentCommandStep1Impl.java │ │ ├── SetVariablesCommandStep1Impl.java │ │ ├── StreamJobsCommandStep1Impl.java │ │ ├── ThrowErrorCommandStep1Impl.java │ │ ├── TopologyRequestStep1Impl.java │ │ ├── UnassignUserTaskCommandStep1Impl.java │ │ ├── UpdateRetriesJobCommandStep1Impl.java │ │ ├── UpdateTimeoutJobCommandStep1Impl.java │ │ ├── UpdateUserTaskCommandStep1Impl.java │ │ └── ZeebeFutureImpl.java │ │ └── tracing │ │ ├── DefaultTracingRecorder.java │ │ ├── OpenTelemetryTracingRecorder.java │ │ ├── TracingRecorder.java │ │ ├── ZeebeForwardingClient.java │ │ ├── ZeebeOpenTelemetryClientInterceptor.java │ │ └── ZeebeTracing.java │ └── resources │ └── META-INF │ ├── quarkus-extension.yaml │ └── services │ └── io.quarkus.dev.spi.HotReplacementSetup └── test ├── pom.xml └── src └── main └── java └── io └── quarkiverse └── zeebe └── test ├── InjectZeebeClient.java ├── InjectZeebeTestEngine.java ├── ZeebeTestEmbeddedResource.java └── ZeebeTestResource.java /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | "README.md" 4 | ], 5 | "imageSize": 100, 6 | "commit": false, 7 | "contributors": [ 8 | { 9 | "login": "andrejpetras", 10 | "name": "Andrej Petras", 11 | "avatar_url": "https://avatars2.githubusercontent.com/u/828045?v=4", 12 | "profile": "https://www.lorislab.org", 13 | "contributions": [ 14 | "code", 15 | "maintenance" 16 | ] 17 | } 18 | ], 19 | "contributorsPerLine": 7, 20 | "projectName": "quarkus-operator-sdk", 21 | "projectOwner": "quarkiverse", 22 | "repoType": "github", 23 | "repoHost": "https://github.com", 24 | "skipCi": true 25 | } -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Lines starting with '#' are comments. 2 | # Each line is a file pattern followed by one or more owners. 3 | 4 | # More details are here: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners 5 | 6 | # The '*' pattern is global owners. 7 | 8 | # Order is important. The last matching pattern has the most precedence. 9 | # The folders are ordered as follows: 10 | 11 | # In each subsection folders are ordered first by depth, then alphabetically. 12 | # This should make it easy to add new rules without breaking existing ones. 13 | 14 | * @quarkiverse/quarkiverse-zeebe 15 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "maven" 9 | directory: "/" 10 | schedule: 11 | interval: "daily" 12 | ignore: 13 | - dependency-name: "org.apache.maven.plugins:maven-compiler-plugin" -------------------------------------------------------------------------------- /.github/project.yml: -------------------------------------------------------------------------------- 1 | name: Camunda Zeebe Quarkus extension 2 | release: 3 | current-version: 1.6.0 4 | next-version: 999-SNAPSHOT 5 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches: 6 | - "main" 7 | paths-ignore: 8 | - '.gitignore' 9 | - 'CODEOWNERS' 10 | - 'LICENSE' 11 | - '*.md' 12 | - '*.adoc' 13 | - '*.txt' 14 | - '.all-contributorsrc' 15 | pull_request: 16 | paths-ignore: 17 | - '.gitignore' 18 | - 'CODEOWNERS' 19 | - 'LICENSE' 20 | - '*.md' 21 | - '*.adoc' 22 | - '*.txt' 23 | - '.all-contributorsrc' 24 | 25 | concurrency: 26 | group: ${{ github.workflow }}-${{ github.ref }} 27 | cancel-in-progress: true 28 | 29 | defaults: 30 | run: 31 | shell: bash 32 | 33 | jobs: 34 | build: 35 | name: Build on ${{ matrix.os }} 36 | strategy: 37 | fail-fast: false 38 | matrix: 39 | # os: [windows-latest, macos-latest, ubuntu-latest] 40 | os: [ubuntu-latest] 41 | runs-on: ${{ matrix.os }} 42 | steps: 43 | - name: Prepare git 44 | run: git config --global core.autocrlf false 45 | if: startsWith(matrix.os, 'windows') 46 | 47 | - uses: actions/checkout@v4 48 | - name: Set up JDK 21 49 | uses: actions/setup-java@v4 50 | with: 51 | distribution: temurin 52 | java-version: 21 53 | cache: 'maven' 54 | 55 | - name: Build with Maven 56 | run: mvn -B clean install -Dno-format 57 | 58 | - name: Build with Maven (Native) 59 | run: mvn -B install -Dnative -Dquarkus.native.container-build -Dnative.surefire.skip -------------------------------------------------------------------------------- /.github/workflows/pre-release.yml: -------------------------------------------------------------------------------- 1 | name: Quarkiverse Pre Release 2 | 3 | on: 4 | pull_request: 5 | paths: 6 | - '.github/project.yml' 7 | 8 | concurrency: 9 | group: ${{ github.workflow }}-${{ github.ref }} 10 | cancel-in-progress: true 11 | 12 | jobs: 13 | pre-release: 14 | name: Pre-Release 15 | uses: quarkiverse/.github/.github/workflows/pre-release.yml@main 16 | secrets: inherit 17 | -------------------------------------------------------------------------------- /.github/workflows/quarkus-snapshot.yaml: -------------------------------------------------------------------------------- 1 | name: "Quarkus ecosystem CI" 2 | on: 3 | workflow_dispatch: 4 | watch: 5 | types: [ started ] 6 | 7 | # For this CI to work, ECOSYSTEM_CI_TOKEN needs to contain a GitHub with rights to close the Quarkus issue that the user/bot has opened, 8 | # while 'ECOSYSTEM_CI_REPO_PATH' needs to be set to the corresponding path in the 'quarkusio/quarkus-ecosystem-ci' repository 9 | 10 | env: 11 | ECOSYSTEM_CI_REPO: quarkusio/quarkus-ecosystem-ci 12 | ECOSYSTEM_CI_REPO_FILE: context.yaml 13 | JAVA_VERSION: 21 14 | 15 | ######################### 16 | # Repo specific setting # 17 | ######################### 18 | 19 | ECOSYSTEM_CI_REPO_PATH: quarkiverse-zeebe 20 | 21 | concurrency: 22 | group: ${{ github.workflow }}-${{ github.ref }} 23 | cancel-in-progress: true 24 | 25 | defaults: 26 | run: 27 | shell: bash 28 | 29 | jobs: 30 | build: 31 | name: "Build against latest Quarkus snapshot" 32 | runs-on: ubuntu-latest 33 | # Allow to manually launch the ecosystem CI in addition to the bots 34 | if: github.actor == 'quarkusbot' || github.actor == 'quarkiversebot' || github.actor == '' 35 | 36 | steps: 37 | - name: Install yq 38 | uses: dcarbone/install-yq-action@v1.0.1 39 | 40 | - name: Set up Java 41 | uses: actions/setup-java@v4 42 | with: 43 | distribution: temurin 44 | java-version: ${{ env.JAVA_VERSION }} 45 | 46 | - name: Checkout repo 47 | uses: actions/checkout@v4 48 | with: 49 | path: current-repo 50 | 51 | - name: Checkout Ecosystem 52 | uses: actions/checkout@v4 53 | with: 54 | repository: ${{ env.ECOSYSTEM_CI_REPO }} 55 | path: ecosystem-ci 56 | 57 | - name: Setup and Run Tests 58 | run: ./ecosystem-ci/setup-and-test 59 | env: 60 | ECOSYSTEM_CI_TOKEN: ${{ secrets.ECOSYSTEM_CI_TOKEN }} -------------------------------------------------------------------------------- /.github/workflows/release-perform.yml: -------------------------------------------------------------------------------- 1 | name: Quarkiverse Perform Release 2 | run-name: Perform ${{github.event.inputs.tag || github.ref_name}} Release 3 | on: 4 | push: 5 | tags: 6 | - '*' 7 | workflow_dispatch: 8 | inputs: 9 | tag: 10 | description: 'Tag to release' 11 | required: true 12 | 13 | permissions: 14 | attestations: write 15 | id-token: write 16 | contents: read 17 | 18 | concurrency: 19 | group: ${{ github.workflow }}-${{ github.ref }} 20 | cancel-in-progress: true 21 | 22 | jobs: 23 | perform-release: 24 | name: Perform Release 25 | uses: quarkiverse/.github/.github/workflows/perform-release.yml@main 26 | secrets: inherit 27 | with: 28 | java_version: 21 29 | version: ${{github.event.inputs.tag || github.ref_name}} 30 | -------------------------------------------------------------------------------- /.github/workflows/release-prepare.yml: -------------------------------------------------------------------------------- 1 | name: Quarkiverse Prepare Release 2 | 3 | on: 4 | pull_request: 5 | types: [ closed ] 6 | paths: 7 | - '.github/project.yml' 8 | 9 | concurrency: 10 | group: ${{ github.workflow }}-${{ github.ref }} 11 | cancel-in-progress: true 12 | 13 | jobs: 14 | prepare-release: 15 | name: Prepare Release 16 | if: ${{ github.event.pull_request.merged == true}} 17 | uses: quarkiverse/.github/.github/workflows/prepare-release.yml@main 18 | secrets: inherit 19 | with: 20 | java_version: 21 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | pom.xml.tag 3 | pom.xml.releaseBackup 4 | pom.xml.versionsBackup 5 | pom.xml.next 6 | release.properties 7 | dependency-reduced-pom.xml 8 | buildNumber.properties 9 | .mvn/timing.properties 10 | *.iml 11 | .idea 12 | *.iml 13 | 14 | # Avoid ignoring Maven wrapper jar file (.jar files are usually ignored) 15 | !/.mvn/wrapper/maven-wrapper.jar 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Quarkus Zeebe 2 | 3 | 4 | [![Build](https://github.com/quarkiverse/quarkus-zeebe/workflows/Build/badge.svg?branch=main)](https://github.com/quarkiverse/quarkus-zeebe/actions?query=workflow%3ABuild) 5 | [![License](https://img.shields.io/github/license/quarkiverse/quarkus-zeebe.svg)](http://www.apache.org/licenses/LICENSE-2.0) 6 | [![Central](https://img.shields.io/maven-central/v/io.quarkiverse.zeebe/quarkus-zeebe-parent?color=green)](https://central.sonatype.com/artifact/io.quarkiverse.zeebe/quarkus-zeebe-parent) 7 | 8 | [![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-) 9 | 10 | 11 | Quarkus [Zeebe](https://docs.camunda.io/docs/components/zeebe/zeebe-overview/) extension. Zeebe’s cloud-native design provides the performance, resilience, and security enterprises need to future-proof their process orchestration efforts. 12 | 13 | ## Documentation 14 | 15 | Refer to the comprehensive [documentation](https://quarkiverse.github.io/quarkiverse-docs/quarkus-zeebe/dev/index.html) for detailed information and usage guidelines. 16 | 17 | ## Contributors ✨ 18 | 19 | Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |

Andrej Petras

💻 🚧
29 | 30 | 31 | 32 | 33 | 34 | 35 | This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. 36 | Contributions of any kind welcome! 37 | -------------------------------------------------------------------------------- /deployment/src/main/java/io/quarkiverse/zeebe/JobWorkerMethodItem.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe; 2 | 3 | import org.jboss.jandex.MethodInfo; 4 | 5 | import io.quarkiverse.zeebe.runtime.JobWorkerValue; 6 | import io.quarkus.arc.processor.BeanInfo; 7 | import io.quarkus.builder.item.MultiBuildItem; 8 | 9 | public final class JobWorkerMethodItem extends MultiBuildItem { 10 | 11 | private final BeanInfo bean; 12 | private final JobWorkerValue worker; 13 | private final MethodInfo method; 14 | private final boolean nonBlocking; 15 | 16 | public JobWorkerMethodItem(BeanInfo bean, MethodInfo method, JobWorkerValue worker, String returnType) { 17 | this(bean, method, worker, false); 18 | } 19 | 20 | public JobWorkerMethodItem(BeanInfo bean, MethodInfo method, JobWorkerValue worker, 21 | boolean hasNonBlockingAnnotation) { 22 | this.bean = bean; 23 | this.method = method; 24 | this.worker = worker; 25 | this.nonBlocking = hasNonBlockingAnnotation 26 | || ZeebeDotNames.COMPLETION_STAGE.equals(method.returnType().name()) 27 | || ZeebeDotNames.UNI.equals(method.returnType().name()); 28 | } 29 | 30 | public BeanInfo getBean() { 31 | return bean; 32 | } 33 | 34 | public MethodInfo getMethod() { 35 | return method; 36 | } 37 | 38 | public JobWorkerValue getWorker() { 39 | return worker; 40 | } 41 | 42 | public boolean isNonBlocking() { 43 | return nonBlocking; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /deployment/src/main/java/io/quarkiverse/zeebe/ZeebeDevServiceBuildTimeConfig.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe; 2 | 3 | import io.quarkiverse.zeebe.devservices.ZeebeDevServicesConfig; 4 | import io.quarkus.runtime.annotations.ConfigPhase; 5 | import io.quarkus.runtime.annotations.ConfigRoot; 6 | import io.smallrye.config.ConfigMapping; 7 | import io.smallrye.config.WithDefault; 8 | import io.smallrye.config.WithName; 9 | 10 | @ConfigRoot(phase = ConfigPhase.BUILD_TIME) 11 | @ConfigMapping(prefix = "quarkus.zeebe") 12 | public interface ZeebeDevServiceBuildTimeConfig { 13 | 14 | /** 15 | * Default Dev services configuration. 16 | */ 17 | @WithName("devservices") 18 | ZeebeDevServicesConfig devService(); 19 | 20 | /** 21 | * Dev mode configuration. 22 | */ 23 | @WithName("dev-mode") 24 | DevMode devMode(); 25 | 26 | interface DevMode { 27 | 28 | /** 29 | * Disable or enabled zeebe dashboard dev-ui. 30 | */ 31 | @WithName("dev-ui.enabled") 32 | @WithDefault("true") 33 | boolean devUIEnabled(); 34 | 35 | /** 36 | * Observe changes in the bpmn files. 37 | */ 38 | @WithName("watch-bpmn-files") 39 | @WithDefault("true") 40 | boolean watchBpmnFiles(); 41 | 42 | /** 43 | * Observe changes in the bpmn directory and subdirectories. 44 | */ 45 | @WithName("watch-bpmn-dir") 46 | @WithDefault("true") 47 | boolean watchBpmnDir(); 48 | 49 | /** 50 | * Observe changes in the job worker. 51 | */ 52 | @WithName("watch-job-worker") 53 | @WithDefault("true") 54 | boolean watchJobWorker(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /deployment/src/main/java/io/quarkiverse/zeebe/ZeebeDotNames.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe; 2 | 3 | import java.util.Map; 4 | import java.util.concurrent.CompletionStage; 5 | 6 | import org.jboss.jandex.DotName; 7 | 8 | import io.camunda.zeebe.client.api.response.ActivatedJob; 9 | import io.camunda.zeebe.client.api.worker.JobClient; 10 | import io.smallrye.common.annotation.NonBlocking; 11 | 12 | public class ZeebeDotNames { 13 | 14 | static final DotName JOB_WORKER = DotName.createSimple(JobWorker.class.getName()); 15 | 16 | static final DotName NON_BLOCKING = DotName.createSimple(NonBlocking.class.getName()); 17 | static final DotName UNI = DotName.createSimple("io.smallrye.mutiny.Uni"); 18 | static final DotName COMPLETION_STAGE = DotName.createSimple(CompletionStage.class.getName()); 19 | 20 | static final DotName JOB_CLIENT = DotName.createSimple(JobClient.class.getName()); 21 | 22 | static final DotName ACTIVATED_JOB = DotName.createSimple(ActivatedJob.class.getName()); 23 | 24 | static final DotName VARIABLE = DotName.createSimple(Variable.class.getName()); 25 | 26 | static final DotName VARIABLE_AS_TYPE = DotName.createSimple(VariablesAsType.class.getName()); 27 | 28 | static final DotName CUSTOM_HEADER = DotName.createSimple(CustomHeader.class.getName()); 29 | 30 | static final DotName CUSTOM_HEADERS = DotName.createSimple(CustomHeaders.class.getName()); 31 | 32 | static final DotName STRING = DotName.createSimple(String.class.getName()); 33 | 34 | static final DotName MAP = DotName.createSimple(Map.class.getName()); 35 | } 36 | -------------------------------------------------------------------------------- /deployment/src/main/java/io/quarkiverse/zeebe/ZeebeResourcesBuildItem.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe; 2 | 3 | import java.util.Collection; 4 | 5 | import io.quarkus.builder.item.SimpleBuildItem; 6 | 7 | public final class ZeebeResourcesBuildItem extends SimpleBuildItem { 8 | 9 | final Collection resources; 10 | 11 | public ZeebeResourcesBuildItem(Collection resources) { 12 | this.resources = resources; 13 | } 14 | 15 | public Collection getResources() { 16 | return resources; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /deployment/src/main/java/io/quarkiverse/zeebe/ZeebeWorkersBuildItem.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe; 2 | 3 | import java.util.List; 4 | 5 | import io.quarkiverse.zeebe.runtime.JobWorkerMetadata; 6 | import io.quarkus.builder.item.SimpleBuildItem; 7 | 8 | public final class ZeebeWorkersBuildItem extends SimpleBuildItem { 9 | 10 | final List workers; 11 | 12 | public ZeebeWorkersBuildItem(List workers) { 13 | this.workers = workers; 14 | } 15 | 16 | public List getWorkers() { 17 | return workers; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /deployment/src/main/java/io/quarkiverse/zeebe/devservices/ContainerShutdownCloseable.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.devservices; 2 | 3 | import java.io.Closeable; 4 | import java.util.Objects; 5 | 6 | import org.jboss.logging.Logger; 7 | import org.testcontainers.containers.GenericContainer; 8 | import org.testcontainers.utility.TestcontainersConfiguration; 9 | 10 | /** 11 | * Helper to define the stop strategy for containers created by DevServices. 12 | * In particular, we don't want to actually stop the containers when they 13 | * have been flagged for reuse, and when the Testcontainers configuration 14 | * has been explicitly set to allow container reuse. 15 | * To enable reuse, ass {@literal testcontainers.reuse.enable=true} in your 16 | * {@literal .testcontainers.properties} file, to be stored in your home. 17 | * 18 | * @see Reusable Containers 19 | * @see Testcontainers Configuration. 20 | */ 21 | public class ContainerShutdownCloseable implements Closeable { 22 | 23 | private static final Logger LOG = Logger.getLogger(ContainerShutdownCloseable.class); 24 | 25 | private final GenericContainer container; 26 | 27 | private final String friendlyServiceName; 28 | 29 | /** 30 | * @param container the container to be eventually closed 31 | * @param friendlyServiceName for logging purposes 32 | */ 33 | public ContainerShutdownCloseable(GenericContainer container, String friendlyServiceName) { 34 | Objects.requireNonNull(container); 35 | Objects.requireNonNull(friendlyServiceName); 36 | this.container = container; 37 | this.friendlyServiceName = friendlyServiceName; 38 | } 39 | 40 | @Override 41 | public void close() { 42 | if (TestcontainersConfiguration.getInstance().environmentSupportsReuse() 43 | && container.isShouldBeReused()) { 44 | LOG.infof( 45 | "Dev Services for %s is no longer needed by this Quarkus instance, but is not shut down as 'testcontainers.reuse.enable' is enabled in your Testcontainers configuration file", 46 | friendlyServiceName); 47 | } else { 48 | container.stop(); 49 | LOG.infof("Dev Services for %s shut down.", this.friendlyServiceName); 50 | } 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /deployment/src/main/java/io/quarkiverse/zeebe/devservices/ZeebeDevServicesProviderBuildItem.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.devservices; 2 | 3 | import io.quarkus.builder.item.SimpleBuildItem; 4 | 5 | public final class ZeebeDevServicesProviderBuildItem extends SimpleBuildItem { 6 | 7 | public String zeebeInternalUrl; 8 | 9 | public ZeebeDevServicesProviderBuildItem(String zeebeInternalUrl) { 10 | this.zeebeInternalUrl = zeebeInternalUrl; 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /deployment/src/main/resources/dev-ui/zeebe/components/zeebe-instance-cancel-dialog.js: -------------------------------------------------------------------------------- 1 | import { JsonRpc } from 'jsonrpc'; 2 | import { notifier } from 'notifier'; 3 | import { LitElement, html } from 'lit'; 4 | import { dialogRenderer, dialogFooterRenderer } from '@vaadin/dialog/lit.js'; 5 | 6 | export class ZeebeInstanceCancelDialog extends LitElement { 7 | 8 | static properties = { 9 | _opened: { state: true }, 10 | context: {}, 11 | _id: { state: true }, 12 | } 13 | 14 | connectedCallback() { 15 | super.connectedCallback(); 16 | this._opened = false; 17 | this.jsonRpc = new JsonRpc(this.context.extension); 18 | } 19 | 20 | open(id) { 21 | this._id = id; 22 | this._opened = true; 23 | } 24 | 25 | render() { 26 | return html` 27 | {this._opened = e.detail.value;}} 29 | ${dialogRenderer(() => this._render(), [this._id])} 30 | ${dialogFooterRenderer(this._footer, [])} 31 | > 32 | 33 | `; 34 | } 35 | 36 | _render() { 37 | return html`Are you sure you want to cancel ${this._id} process instance?`; 38 | } 39 | 40 | _footer = () => html` 41 | No, cancel 42 | Yes, I'm sure 43 | `; 44 | 45 | _close() { 46 | this._opened = false 47 | } 48 | 49 | _action() { 50 | this.jsonRpc.cancelProcessInstance({processInstanceKey: this._id}) 51 | .then(response => { 52 | console.log(response); 53 | this._close(); 54 | }) 55 | .catch(e => { 56 | console.log(e); 57 | notifier.showErrorMessage('Cancel process instance error: ' + e.error.code + ' message: ' + e.error.message, null) 58 | }); 59 | } 60 | 61 | } 62 | 63 | customElements.define('zeebe-instance-cancel-dialog', ZeebeInstanceCancelDialog); -------------------------------------------------------------------------------- /deployment/src/main/resources/dev-ui/zeebe/components/zeebe-table.js: -------------------------------------------------------------------------------- 1 | import { LitElement, html, css } from 'lit'; 2 | import '@vaadin/grid'; 3 | 4 | export class ZeebeTable extends LitElement { 5 | 6 | static styles = css` 7 | .table { 8 | --vaadin-focus-ring-width: 0px; 9 | } 10 | .flex-auto { 11 | flex: 1 1 auto; 12 | } 13 | a { 14 | cursor: pointer; 15 | color: var(--quarkus-blue); 16 | } 17 | `; 18 | 19 | static properties = { 20 | _items: {state: true}, 21 | _filteredItems: {state: true}, 22 | _searchBar: { state: true}, 23 | }; 24 | 25 | set items(val) { 26 | this._items = val; 27 | this._filteredItems = this._items; 28 | } 29 | 30 | set withoutSearchBar(val) { 31 | this._items = val; 32 | this._filteredItems = this._items; 33 | this._searchBar = false; 34 | } 35 | 36 | connectedCallback() { 37 | super.connectedCallback(); 38 | this._searchBar = true; 39 | } 40 | 41 | render() { 42 | return html` 43 | 44 | 45 | 46 | 47 |
48 | 49 |
50 | 51 | 52 | 53 | 54 | `; 55 | } 56 | 57 | _searchTable(e) { 58 | if (!this._searchBar) { 59 | return; 60 | } 61 | if (!this._items || this._items.length <= 0) { 62 | return; 63 | } 64 | 65 | const searchTerm = (e.detail.value || '').trim(); 66 | const matchesTerm = (value) => value.toLowerCase().includes(searchTerm.toLowerCase()); 67 | this._filteredItems = this._items.filter(({ searchTerms }) => matchesTerm(searchTerms)); 68 | } 69 | } 70 | 71 | customElements.define('zeebe-table', ZeebeTable); -------------------------------------------------------------------------------- /deployment/src/main/resources/dev-ui/zeebe/components/zeebe-utils.js: -------------------------------------------------------------------------------- 1 | import { html} from 'lit'; 2 | import '@vaadin/icon'; 3 | 4 | export function diagramId(diagram, id) { 5 | return html` 6 | diagram.value.addMarker(id)} 8 | @mouseout=${() => diagram.value.removeMarker(id)} 9 | > 10 | `; 11 | } -------------------------------------------------------------------------------- /deployment/src/main/resources/dev-ui/zeebe/components/zeebe-variable-history-dialog.js: -------------------------------------------------------------------------------- 1 | import { LitElement, html } from 'lit'; 2 | import { dialogRenderer, dialogFooterRenderer } from '@vaadin/dialog/lit.js'; 3 | import './zeebe-table.js'; 4 | 5 | export class ZeebeVariableHistoryDialog extends LitElement { 6 | 7 | static properties = { 8 | _opened: { state: true }, 9 | context: {}, 10 | _variables: { state: true }, 11 | _searchBar: {}, 12 | } 13 | 14 | connectedCallback() { 15 | super.connectedCallback(); 16 | this._opened = false; 17 | this._variables = [] 18 | this._searchBar = false; 19 | } 20 | 21 | open(variables) { 22 | this._variables = variables; 23 | this._opened = true; 24 | } 25 | 26 | render() { 27 | return html` 28 | {this._opened = e.detail.value;}} 30 | ${dialogRenderer(() => this._render(), [this._item])} 31 | ${dialogFooterRenderer(this._footer, [])} 32 | > 33 | 34 | `; 35 | } 36 | 37 | _render() { 38 | return html` 39 | 40 | 41 | 42 | 43 | 44 | 45 | `; 46 | } 47 | 48 | _footer = () => html` 49 | Close 50 | `; 51 | 52 | _close() { 53 | this._opened = false 54 | } 55 | 56 | } 57 | 58 | customElements.define('zeebe-variable-history-dialog', ZeebeVariableHistoryDialog); -------------------------------------------------------------------------------- /deployment/src/main/resources/dev-ui/zeebe/zeebe-instances.js: -------------------------------------------------------------------------------- 1 | import { LitElement, html } from 'lit'; 2 | import { JsonRpc } from 'jsonrpc'; 3 | import { columnBodyRenderer } from '@vaadin/grid/lit.js'; 4 | import './components/zeebe-table.js'; 5 | 6 | export class ZeebeInstances extends LitElement { 7 | 8 | static properties = { 9 | _items: {state: true}, 10 | navigation: {}, 11 | }; 12 | 13 | connectedCallback() { 14 | super.connectedCallback(); 15 | this.jsonRpc = new JsonRpc(this.context.extension); 16 | this._fetchData(); 17 | 18 | this._observer = this.jsonRpc.notifications().onNext(response => { 19 | this._fetchData(); 20 | if (response.result.event === 'PROCESS_INSTANCE') { 21 | this._fetchData(); 22 | } 23 | }); 24 | } 25 | 26 | disconnectedCallback() { 27 | this._observer.cancel(); 28 | super.disconnectedCallback() 29 | } 30 | 31 | _fetchData() { 32 | this.jsonRpc.instances() 33 | .then(itemResponse => { 34 | this._items = itemResponse.result.map((item) => ({ 35 | ...item, 36 | searchTerms: `${item.id} ${item.record.value.bpmnProcessId} ${item.record.value.processDefinitionKey}` 37 | })); 38 | }); 39 | } 40 | 41 | render() { 42 | return html` 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | `; 52 | } 53 | 54 | _instanceKeyRenderer(item) { 55 | return html` 56 | this.navigation({ nav: "instance", id: item.id })}>${item.id} 57 | `; 58 | } 59 | 60 | } 61 | 62 | customElements.define('zeebe-instances', ZeebeInstances); -------------------------------------------------------------------------------- /deployment/src/main/resources/dev-ui/zeebe/zeebe-jobs.js: -------------------------------------------------------------------------------- 1 | import { LitElement, html } from 'lit'; 2 | import { JsonRpc } from 'jsonrpc'; 3 | import { columnBodyRenderer } from '@vaadin/grid/lit.js'; 4 | import './components/zeebe-table.js'; 5 | 6 | export class ZeebeJobs extends LitElement { 7 | 8 | static properties = { 9 | _items: {state: true}, 10 | navigation: {}, 11 | }; 12 | 13 | connectedCallback() { 14 | super.connectedCallback(); 15 | this.jsonRpc = new JsonRpc(this.context.extension); 16 | this._fetchData(); 17 | 18 | this._observer = this.jsonRpc.notifications().onNext(response => { 19 | if (response.result.event === 'JOB') { 20 | if (response.result.type === 'UPDATED') { 21 | this._fetchData(); 22 | } 23 | } 24 | }); 25 | } 26 | 27 | disconnectedCallback() { 28 | this._observer.cancel(); 29 | super.disconnectedCallback() 30 | } 31 | 32 | _fetchData() { 33 | this.jsonRpc.jobs() 34 | .then(itemResponse => { 35 | this._items = itemResponse.result.map((item) => ({ 36 | ...item, 37 | searchTerms: `${item.record.value.type} ${item.id} ${item.record.value.processInstanceKey}` 38 | })); 39 | }); 40 | } 41 | 42 | render() { 43 | return html` 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | `; 53 | } 54 | 55 | _instanceKeyRenderer(item) { 56 | return html` 57 | this.navigation({ nav: "instance", id: item.record.value.processInstanceKey })}>${item.record.value.processInstanceKey} 58 | `; 59 | } 60 | 61 | } 62 | 63 | customElements.define('zeebe-jobs', ZeebeJobs); -------------------------------------------------------------------------------- /deployment/src/test/java/io/quarkiverse/zeebe/CustomJsonMapperTest.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe; 2 | 3 | import jakarta.inject.Inject; 4 | 5 | import org.junit.jupiter.api.Assertions; 6 | import org.junit.jupiter.api.DisplayName; 7 | import org.junit.jupiter.api.Test; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import io.quarkiverse.zeebe.test.CustomJsonMapperProducer; 11 | import io.quarkiverse.zeebe.test.Param; 12 | import io.quarkiverse.zeebe.test.TestService; 13 | import io.quarkus.test.QuarkusUnitTest; 14 | 15 | public class CustomJsonMapperTest { 16 | 17 | @RegisterExtension 18 | static final QuarkusUnitTest unitTest = new QuarkusUnitTest() 19 | .withApplicationRoot((jar) -> jar 20 | .addAsResource("no-resources.properties", "application.properties") 21 | .addClasses(CustomJsonMapperProducer.class, TestService.class, Param.class)); 22 | 23 | @Inject 24 | TestService service; 25 | 26 | @Test 27 | @DisplayName("Test custom JSON mapper") 28 | public void testLiquibaseNotAvailableWithoutDataSource() { 29 | Param p = new Param(); 30 | p.name = "test"; 31 | p.value = 100; 32 | String tmp = service.toJson(p); 33 | Assertions.assertEquals("{\"name\":\"test\",\"value\":100}", tmp); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /deployment/src/test/java/io/quarkiverse/zeebe/ZeebeClientConnectionTest.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe; 2 | 3 | import jakarta.inject.Inject; 4 | 5 | import org.junit.jupiter.api.Assertions; 6 | import org.junit.jupiter.api.DisplayName; 7 | import org.junit.jupiter.api.Test; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import io.camunda.zeebe.client.api.response.Topology; 11 | import io.quarkiverse.zeebe.test.TestService; 12 | import io.quarkus.test.QuarkusUnitTest; 13 | 14 | public class ZeebeClientConnectionTest { 15 | 16 | @RegisterExtension 17 | static final QuarkusUnitTest unitTest = new QuarkusUnitTest() 18 | .withApplicationRoot((jar) -> jar 19 | .addAsResource("no-resources.properties", "application.properties") 20 | .addClasses(TestService.class)); 21 | 22 | @Inject 23 | TestService config; 24 | 25 | @Test 26 | @DisplayName("Test default connection") 27 | public void testLiquibaseNotAvailableWithoutDataSource() { 28 | Assertions.assertNotNull(config); 29 | Topology topology = config.topology(); 30 | Assertions.assertNotNull(topology); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /deployment/src/test/java/io/quarkiverse/zeebe/ZeebeProcessTest.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe; 2 | 3 | import jakarta.inject.Inject; 4 | 5 | import org.junit.jupiter.api.Assertions; 6 | import org.junit.jupiter.api.DisplayName; 7 | import org.junit.jupiter.api.Test; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import io.camunda.zeebe.client.api.response.ProcessInstanceEvent; 11 | import io.quarkiverse.zeebe.jobworker.Parameter; 12 | import io.quarkiverse.zeebe.jobworker.TestJobWorker; 13 | import io.quarkiverse.zeebe.test.TestService; 14 | import io.quarkus.test.QuarkusUnitTest; 15 | 16 | public class ZeebeProcessTest { 17 | 18 | @RegisterExtension 19 | static final QuarkusUnitTest unitTest = new QuarkusUnitTest() 20 | .withApplicationRoot((jar) -> jar 21 | .addAsResource("default.properties", "application.properties") 22 | .addAsResource("bpmn/TestProcess.bpmn", "/bpmn/TestProcess.bpmn") 23 | .addClasses(TestService.class, Parameter.class, TestJobWorker.class)); 24 | 25 | @Inject 26 | TestService service; 27 | 28 | @Test 29 | @DisplayName("Test process") 30 | public void testLiquibaseNotAvailableWithoutDataSource() { 31 | Parameter param = new Parameter(); 32 | param.info = "info"; 33 | param.data = "data"; 34 | ProcessInstanceEvent tmp = service.startProcess("TestProcess", param); 35 | Assertions.assertNotNull(tmp); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /deployment/src/test/java/io/quarkiverse/zeebe/jobworker/Parameter.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.jobworker; 2 | 3 | import io.quarkus.runtime.annotations.RegisterForReflection; 4 | 5 | @RegisterForReflection 6 | public class Parameter { 7 | 8 | public String data; 9 | 10 | public String info; 11 | 12 | @Override 13 | public String toString() { 14 | return "Parameter{" + 15 | "data='" + data + '\'' + 16 | ", info='" + info + '\'' + 17 | '}'; 18 | } 19 | } -------------------------------------------------------------------------------- /deployment/src/test/java/io/quarkiverse/zeebe/test/CustomJsonMapperProducer.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.test; 2 | 3 | import java.io.InputStream; 4 | import java.util.Map; 5 | 6 | import jakarta.enterprise.inject.Produces; 7 | 8 | import io.camunda.zeebe.client.api.JsonMapper; 9 | import io.camunda.zeebe.client.impl.ZeebeObjectMapper; 10 | import io.quarkus.logging.Log; 11 | 12 | public class CustomJsonMapperProducer { 13 | 14 | @Produces 15 | public JsonMapper create() { 16 | return new JsonMapper() { 17 | 18 | private ZeebeObjectMapper mapper = new ZeebeObjectMapper(); 19 | 20 | @Override 21 | public T fromJson(String json, Class typeClass) { 22 | Log.infof("fromJson %s, %s", json, typeClass); 23 | return mapper.fromJson(json, typeClass); 24 | } 25 | 26 | @Override 27 | public Map fromJsonAsMap(String json) { 28 | Log.infof("fromJsonAsMap %s", json); 29 | return mapper.fromJsonAsMap(json); 30 | } 31 | 32 | @Override 33 | public Map fromJsonAsStringMap(String json) { 34 | Log.infof("fromJsonAsStringMap %s", json); 35 | return mapper.fromJsonAsStringMap(json); 36 | } 37 | 38 | @Override 39 | public String toJson(Object value) { 40 | Log.infof("toJson %s", value); 41 | return mapper.toJson(value); 42 | } 43 | 44 | @Override 45 | public String validateJson(String propertyName, String jsonInput) { 46 | Log.infof("validateJson %s, %s", propertyName, jsonInput); 47 | return mapper.validateJson(propertyName, jsonInput); 48 | } 49 | 50 | @Override 51 | public String validateJson(String propertyName, InputStream jsonInput) { 52 | Log.infof("validateJson %s, ", propertyName); 53 | return mapper.validateJson(propertyName, jsonInput); 54 | } 55 | }; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /deployment/src/test/java/io/quarkiverse/zeebe/test/Param.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.test; 2 | 3 | public class Param { 4 | 5 | public String name; 6 | public int value; 7 | 8 | @Override 9 | public String toString() { 10 | return "Param{" + 11 | "name='" + name + '\'' + 12 | ", value=" + value + 13 | '}'; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /deployment/src/test/java/io/quarkiverse/zeebe/test/TestService.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.test; 2 | 3 | import jakarta.enterprise.context.ApplicationScoped; 4 | import jakarta.inject.Inject; 5 | 6 | import io.camunda.zeebe.client.ZeebeClient; 7 | import io.camunda.zeebe.client.api.JsonMapper; 8 | import io.camunda.zeebe.client.api.response.ProcessInstanceEvent; 9 | import io.camunda.zeebe.client.api.response.Topology; 10 | 11 | @ApplicationScoped 12 | public class TestService { 13 | 14 | @Inject 15 | ZeebeClient client; 16 | 17 | @Inject 18 | JsonMapper jsonMapper; 19 | 20 | public Topology topology() { 21 | return client.newTopologyRequest().send().join(); 22 | } 23 | 24 | public ProcessInstanceEvent startProcess(String name, Object parameter) { 25 | return client.newCreateInstanceCommand() 26 | .bpmnProcessId(name) 27 | .latestVersion() 28 | .variables(parameter) 29 | .send().join(); 30 | 31 | } 32 | 33 | public String toJson(Object value) { 34 | return jsonMapper.toJson(value); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /deployment/src/test/resources/default.properties: -------------------------------------------------------------------------------- 1 | quarkus.zeebe.resources.location=bpmn 2 | quarkus.zeebe.devservices.watch-bpmn-dir=false -------------------------------------------------------------------------------- /deployment/src/test/resources/no-resources.properties: -------------------------------------------------------------------------------- 1 | quarkus.zeebe.resources.enabled=false -------------------------------------------------------------------------------- /docs/antora.yml: -------------------------------------------------------------------------------- 1 | name: quarkus-zeebe 2 | title: Zeebe 3 | version: dev 4 | nav: 5 | - modules/ROOT/nav.adoc 6 | -------------------------------------------------------------------------------- /docs/images/devui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quarkiverse/quarkus-zeebe/1a1daa3a33e51c86e93ab5e6c8d3f8f01b2e1688/docs/images/devui.png -------------------------------------------------------------------------------- /docs/images/opentelemetry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quarkiverse/quarkus-zeebe/1a1daa3a33e51c86e93ab5e6c8d3f8f01b2e1688/docs/images/opentelemetry.png -------------------------------------------------------------------------------- /docs/modules/ROOT/assets/images/.keepme: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quarkiverse/quarkus-zeebe/1a1daa3a33e51c86e93ab5e6c8d3f8f01b2e1688/docs/modules/ROOT/assets/images/.keepme -------------------------------------------------------------------------------- /docs/modules/ROOT/assets/images/devui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quarkiverse/quarkus-zeebe/1a1daa3a33e51c86e93ab5e6c8d3f8f01b2e1688/docs/modules/ROOT/assets/images/devui.png -------------------------------------------------------------------------------- /docs/modules/ROOT/assets/images/opentelemetry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quarkiverse/quarkus-zeebe/1a1daa3a33e51c86e93ab5e6c8d3f8f01b2e1688/docs/modules/ROOT/assets/images/opentelemetry.png -------------------------------------------------------------------------------- /docs/modules/ROOT/examples/.keepme: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quarkiverse/quarkus-zeebe/1a1daa3a33e51c86e93ab5e6c8d3f8f01b2e1688/docs/modules/ROOT/examples/.keepme -------------------------------------------------------------------------------- /docs/modules/ROOT/nav.adoc: -------------------------------------------------------------------------------- 1 | * xref:index.adoc[Quarkus Zeebe] 2 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/includes/attributes.adoc: -------------------------------------------------------------------------------- 1 | :project-version: 1.6.0 2 | :quarkus-version: 3.15.2 3 | 4 | :quarkus-mockserver-url: https://github.com/quarkiverse/quarkus-zeebe 5 | 6 | :quarkus-org-url: https://github.com/quarkusio 7 | :quarkus-base-url: {quarkus-org-url}/quarkus 8 | :quarkus-clone-url: {quarkus-base-url}.git 9 | :quarkus-archive-url: {quarkus-base-url}/archive/master.zip 10 | :quarkus-tree-url: {quarkus-base-url}/tree/main 11 | :quarkus-issues-url: {quarkus-base-url}/issues 12 | :quarkus-guides-url: https://quarkus.io/guides 13 | :quickstarts-base-url: https://github.com/quarkusio/quarkus-quickstarts 14 | :quickstarts-clone-url: https://github.com/quarkusio/quarkus-quickstarts.git 15 | :quickstarts-archive-url: https://github.com/quarkusio/quarkus-quickstarts/archive/main.zip 16 | :quickstarts-blob-url: https://github.com/quarkusio/quarkus-quickstarts/blob/main 17 | :quickstarts-tree-url: https://github.com/quarkusio/quarkus-quickstarts/tree/main 18 | 19 | :examples-dir: ./../examples/ -------------------------------------------------------------------------------- /docs/templates/includes/attributes.adoc: -------------------------------------------------------------------------------- 1 | :project-version: ${release.current-version} 2 | :quarkus-version: ${quarkus.version} 3 | 4 | :quarkus-mockserver-url: https://github.com/quarkiverse/quarkus-zeebe 5 | 6 | :quarkus-org-url: https://github.com/quarkusio 7 | :quarkus-base-url: {quarkus-org-url}/quarkus 8 | :quarkus-clone-url: {quarkus-base-url}.git 9 | :quarkus-archive-url: {quarkus-base-url}/archive/master.zip 10 | :quarkus-tree-url: {quarkus-base-url}/tree/main 11 | :quarkus-issues-url: {quarkus-base-url}/issues 12 | :quarkus-guides-url: https://quarkus.io/guides 13 | :quickstarts-base-url: https://github.com/quarkusio/quarkus-quickstarts 14 | :quickstarts-clone-url: https://github.com/quarkusio/quarkus-quickstarts.git 15 | :quickstarts-archive-url: https://github.com/quarkusio/quarkus-quickstarts/archive/main.zip 16 | :quickstarts-blob-url: https://github.com/quarkusio/quarkus-quickstarts/blob/main 17 | :quickstarts-tree-url: https://github.com/quarkusio/quarkus-quickstarts/tree/main 18 | 19 | :examples-dir: ./../examples/ -------------------------------------------------------------------------------- /examples/base/README.md: -------------------------------------------------------------------------------- 1 | # Examples 2 | 3 | Start base example application 4 | ```shell 5 | mvn clean compile quarkus:dev 6 | ``` 7 | Start `tests` process instances. 8 | 9 | ```shell 10 | curl http://localhost:8080/process/test 11 | ``` 12 | 13 | Start 'test.complete' process instance. 14 | 15 | ```shell 16 | curl http://localhost:8080/process/test/test.complete 17 | ``` 18 | 19 | ```shell 20 | curl http://localhost:8080/process/test/test.exception 21 | ``` 22 | -------------------------------------------------------------------------------- /examples/base/src/main/java/io/quarkiverse/zeebe/examples/base/Parameter.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.examples.base; 2 | 3 | import io.quarkus.runtime.annotations.RegisterForReflection; 4 | 5 | @RegisterForReflection 6 | public class Parameter { 7 | 8 | public String data; 9 | 10 | public String info; 11 | 12 | @Override 13 | public String toString() { 14 | return "Parameter{" + 15 | "data='" + data + '\'' + 16 | ", info='" + info + '\'' + 17 | '}'; 18 | } 19 | } -------------------------------------------------------------------------------- /examples/base/src/main/java/io/quarkiverse/zeebe/examples/base/ProcessRestController.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.examples.base; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import jakarta.inject.Inject; 8 | import jakarta.ws.rs.GET; 9 | import jakarta.ws.rs.Path; 10 | import jakarta.ws.rs.PathParam; 11 | import jakarta.ws.rs.Produces; 12 | import jakarta.ws.rs.core.MediaType; 13 | import jakarta.ws.rs.core.Response; 14 | 15 | import io.camunda.zeebe.client.ZeebeClient; 16 | import io.camunda.zeebe.client.api.response.ProcessInstanceEvent; 17 | 18 | @Path("process/test") 19 | @Produces(MediaType.APPLICATION_JSON) 20 | public class ProcessRestController { 21 | 22 | @Inject 23 | ZeebeClient zeebe; 24 | 25 | @GET 26 | public Response startTests() { 27 | List result = new ArrayList<>(); 28 | try { 29 | result.add(start("test.complete")); 30 | result.add(start("test.exception")); 31 | result.add(start("test.fail")); 32 | result.add(start("test.throw")); 33 | return Response.ok(result).build(); 34 | } catch (Exception ex) { 35 | return Response.serverError().entity(ex.getMessage()).build(); 36 | } 37 | } 38 | 39 | @GET 40 | @Path("{name}") 41 | public Response startTest(@PathParam("name") String name) { 42 | try { 43 | return Response.ok(start(name)).build(); 44 | } catch (Exception ex) { 45 | return Response.serverError().entity(ex.getMessage()).build(); 46 | } 47 | } 48 | 49 | private ProcessInstanceEvent start(String processId) { 50 | return zeebe.newCreateInstanceCommand() 51 | .bpmnProcessId(processId) 52 | .latestVersion() 53 | .variables(Map.of("data", "1")) 54 | .send().join(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /examples/base/src/main/java/io/quarkiverse/zeebe/examples/base/TestJobWorker.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.examples.base; 2 | 3 | import java.util.Map; 4 | 5 | import jakarta.enterprise.context.ApplicationScoped; 6 | import jakarta.inject.Inject; 7 | 8 | import io.camunda.zeebe.client.api.response.ActivatedJob; 9 | import io.camunda.zeebe.client.api.worker.JobClient; 10 | import io.quarkiverse.zeebe.CustomHeaders; 11 | import io.quarkiverse.zeebe.JobWorker; 12 | import io.quarkiverse.zeebe.Variable; 13 | import io.quarkiverse.zeebe.VariablesAsType; 14 | import io.quarkus.logging.Log; 15 | 16 | @ApplicationScoped 17 | public class TestJobWorker { 18 | 19 | @Inject 20 | TestService service; 21 | 22 | @JobWorker(name = "test.complete.action", type = "test.complete") 23 | public Parameter testComplete(@VariablesAsType Parameter p) { 24 | p.info = "test.complete-info"; 25 | p.data = service.getParam(); 26 | Log.infof("Test complete. Parameter: %s", p); 27 | return p; 28 | } 29 | 30 | @JobWorker(name = "test.complete.action2", type = "test.complete2") 31 | public Parameter testComplete2(@Variable boolean info, @VariablesAsType Parameter p, 32 | @CustomHeaders Map headers) { 33 | p.info = info + "test.complete"; 34 | p.data = service.getParam(); 35 | return p; 36 | } 37 | 38 | @JobWorker(name = "test.exception.action", type = "test.exception") 39 | public void testException(@VariablesAsType Parameter p) { 40 | p.info = "test.exception"; 41 | p.data = service.getParam(); 42 | throw new RuntimeException("Error custom exception message"); 43 | } 44 | 45 | @JobWorker(name = "test.fail.action", type = "test.fail", autoComplete = false) 46 | public void testFail(JobClient client, ActivatedJob job, @VariablesAsType Parameter p) { 47 | p.info = "test.fail"; 48 | p.data = service.getParam(); 49 | client.newFailCommand(job).retries(job.getRetries() - 1) 50 | .errorMessage("Fail custom error message").send().join(); 51 | } 52 | 53 | @JobWorker(name = "test.throw.action", type = "test.throw", autoComplete = false) 54 | public void testThrow(JobClient client, ActivatedJob job, @VariablesAsType Parameter p) { 55 | p.info = "test.throw"; 56 | p.data = service.getParam(); 57 | client.newThrowErrorCommand(job).errorCode("throw custom error code") 58 | .errorMessage("throw custom error message") 59 | .send().join(); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /examples/base/src/main/java/io/quarkiverse/zeebe/examples/base/TestService.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.examples.base; 2 | 3 | import java.util.UUID; 4 | 5 | import jakarta.enterprise.context.ApplicationScoped; 6 | 7 | @ApplicationScoped 8 | public class TestService { 9 | 10 | public String getParam() { 11 | return UUID.randomUUID().toString(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/base/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | quarkus.banner.enabled=false 2 | quarkus.analytics.disabled=false 3 | -------------------------------------------------------------------------------- /examples/base/src/main/resources/bpmn/simple.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Flow_1hvcqit 6 | 7 | 8 | Flow_1hvcqit 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /examples/base/src/main/resources/bpmn/simple_process.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Flow_1vio60j 6 | 7 | 8 | Flow_1vio60j 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /examples/base/src/main/resources/bpmn/simple_signal.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Flow_030vxsc 6 | 7 | 8 | 9 | Flow_1lp92r4 10 | 11 | 12 | 13 | Flow_030vxsc 14 | Flow_1lp92r4 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /examples/base/src/main/resources/bpmn/simple_start_signal.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Flow_0jinn1p 6 | 7 | 8 | 9 | Flow_0jinn1p 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /examples/base/src/main/resources/bpmn/start_message.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Flow_1eafvay 6 | 7 | 8 | 9 | Flow_1eafvay 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /examples/base/src/main/resources/bpmn/start_timer.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Flow_1ra9im1 6 | 7 | 8 | 9 | Flow_1ra9im1 10 | 11 | 2030-10-01T12:00:00Z 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /examples/opentelemetry/README.md: -------------------------------------------------------------------------------- 1 | # Examples 2 | 3 | Start `zeebe` and `opentelemetry` environment 4 | ```shell 5 | docker-compose up 6 | ``` 7 | 8 | Start example application 9 | ```shell 10 | mvn clean compile quarkus:dev 11 | ``` 12 | 13 | ## OpenTelemetry test 14 | 15 | Start `test` process instances. 16 | 17 | ```shell 18 | curl http://localhost:8080/process/test 19 | ``` 20 | -------------------------------------------------------------------------------- /examples/opentelemetry/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | services: 3 | 4 | # Jaeger 5 | jaeger-all-in-one: 6 | image: jaegertracing/all-in-one:1.58 7 | ports: 8 | - "16686:16686" # Jaeger UI 9 | - "14268:14268" # Receive legacy OpenTracing traces, optional 10 | - "4317:4317" # OTLP gRPC receiver 11 | - "4318:4318" # OTLP HTTP receiver, not yet used by Quarkus, optional 12 | - "14250:14250" # Receive from external otel-collector, optional 13 | environment: 14 | COLLECTOR_OTLP_ENABLED: "true" -------------------------------------------------------------------------------- /examples/opentelemetry/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | io.quarkiverse.zeebe 4 | quarkus-zeebe-examples 5 | 999-SNAPSHOT 6 | ../pom.xml 7 | 8 | 4.0.0 9 | 10 | quarkus-zeebe-examples-opentelemetry 11 | Quarkus - Zeebe - Examples - OpenTelemetry 12 | Quarkus Zeebe examples OpenTelemetry 13 | 14 | 15 | 16 | io.quarkiverse.zeebe 17 | quarkus-zeebe 18 | ${project.version} 19 | 20 | 21 | io.quarkus 22 | quarkus-rest 23 | 24 | 25 | io.quarkus 26 | quarkus-rest-jackson 27 | 28 | 29 | io.quarkus 30 | quarkus-opentelemetry 31 | 32 | 33 | 34 | 35 | 36 | 37 | io.quarkus 38 | quarkus-maven-plugin 39 | ${quarkus.version} 40 | 41 | 42 | 43 | build 44 | 45 | 46 | 47 | 48 | 49 | maven-surefire-plugin 50 | ${surefire-plugin.version} 51 | 52 | 53 | org.jboss.logmanager.LogManager 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /examples/opentelemetry/src/main/java/io/quarkiverse/zeebe/examples/opentelemetry/Parameter.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.examples.opentelemetry; 2 | 3 | import io.quarkus.runtime.annotations.RegisterForReflection; 4 | 5 | @RegisterForReflection 6 | public class Parameter { 7 | 8 | public String data; 9 | 10 | public String info; 11 | } -------------------------------------------------------------------------------- /examples/opentelemetry/src/main/java/io/quarkiverse/zeebe/examples/opentelemetry/ProcessRestController.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.examples.opentelemetry; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import jakarta.inject.Inject; 8 | import jakarta.ws.rs.GET; 9 | import jakarta.ws.rs.Path; 10 | import jakarta.ws.rs.PathParam; 11 | import jakarta.ws.rs.Produces; 12 | import jakarta.ws.rs.core.MediaType; 13 | import jakarta.ws.rs.core.Response; 14 | 15 | import io.camunda.zeebe.client.ZeebeClient; 16 | import io.camunda.zeebe.client.api.response.ProcessInstanceEvent; 17 | 18 | @Path("process/test") 19 | @Produces(MediaType.APPLICATION_JSON) 20 | public class ProcessRestController { 21 | 22 | @Inject 23 | ZeebeClient zeebe; 24 | 25 | @GET 26 | public Response startTest() { 27 | List result = new ArrayList<>(); 28 | try { 29 | result.add(start("test.complete")); 30 | result.add(start("test.exception")); 31 | result.add(start("test.fail")); 32 | result.add(start("test.throw")); 33 | return Response.ok(result).build(); 34 | } catch (Exception ex) { 35 | return Response.serverError().entity(ex.getMessage()).build(); 36 | } 37 | } 38 | 39 | @GET 40 | @Path("{name}") 41 | public Response startTest(@PathParam("name") String name) { 42 | try { 43 | return Response.ok(start(name)).build(); 44 | } catch (Exception ex) { 45 | return Response.serverError().entity(ex.getMessage()).build(); 46 | } 47 | } 48 | 49 | private ProcessInstanceEvent start(String processId) { 50 | return zeebe.newCreateInstanceCommand() 51 | .bpmnProcessId(processId) 52 | .latestVersion() 53 | .variables(Map.of("data", "1")) 54 | .send().join(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /examples/opentelemetry/src/main/java/io/quarkiverse/zeebe/examples/opentelemetry/TestJobWorker.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.examples.opentelemetry; 2 | 3 | import java.util.Map; 4 | 5 | import jakarta.inject.Inject; 6 | 7 | import io.camunda.zeebe.client.api.response.ActivatedJob; 8 | import io.camunda.zeebe.client.api.worker.JobClient; 9 | import io.quarkiverse.zeebe.JobWorker; 10 | import io.quarkiverse.zeebe.VariablesAsType; 11 | 12 | public class TestJobWorker { 13 | 14 | @Inject 15 | TestService service; 16 | 17 | @JobWorker(name = "open-telemetry-step1", type = "open-telemetry-step1") 18 | public Object openTelemetryStep1(ActivatedJob job) { 19 | return Map.of("step1", true); 20 | } 21 | 22 | @JobWorker(name = "open-telemetry-step2", type = "open-telemetry-step2") 23 | public Object openTelemetryStep2() { 24 | return Map.of("step1", true); 25 | } 26 | 27 | @JobWorker(name = "test.complete.action", type = "test.complete") 28 | public Parameter testComplete(@VariablesAsType Parameter p) { 29 | p.info = "test.complete"; 30 | p.data = service.getParam(); 31 | return p; 32 | } 33 | 34 | @JobWorker(name = "test.exception.action", type = "test.exception") 35 | public void testException(ActivatedJob job) { 36 | Parameter p = job.getVariablesAsType(Parameter.class); 37 | p.info = "test.exception"; 38 | p.data = service.getParam(); 39 | throw new RuntimeException("Error custom exception message"); 40 | } 41 | 42 | @JobWorker(name = "test.fail.action", type = "test.fail", autoComplete = false) 43 | public void testFail(JobClient client, ActivatedJob job) { 44 | Parameter p = job.getVariablesAsType(Parameter.class); 45 | p.info = "test.fail"; 46 | p.data = service.getParam(); 47 | client.newFailCommand(job).retries(job.getRetries() - 1) 48 | .errorMessage("Fail custom error message").send().join(); 49 | } 50 | 51 | @JobWorker(name = "test.throw.action", type = "test.throw", autoComplete = false) 52 | public void testThrow(JobClient client, ActivatedJob job, @VariablesAsType Parameter p) { 53 | p.info = "test.throw"; 54 | p.data = service.getParam(); 55 | client.newThrowErrorCommand(job).errorCode("throw custom error code") 56 | .errorMessage("throw custom error message") 57 | .send().join(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /examples/opentelemetry/src/main/java/io/quarkiverse/zeebe/examples/opentelemetry/TestService.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.examples.opentelemetry; 2 | 3 | import java.util.UUID; 4 | 5 | import jakarta.enterprise.context.ApplicationScoped; 6 | 7 | import io.opentelemetry.instrumentation.annotations.WithSpan; 8 | 9 | @ApplicationScoped 10 | public class TestService { 11 | 12 | @WithSpan 13 | public String getParam() { 14 | return UUID.randomUUID().toString(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /examples/opentelemetry/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | quarkus.banner.enabled=false 2 | quarkus.application.name=open-telemetry-test 3 | quarkus.zeebe.tracing.enabled=true 4 | 5 | quarkus.otel.exporter.otlp.traces.endpoint=http://localhost:4317/ 6 | quarkus.log.console.format=%d{HH:mm:ss} %-5p traceId=%X{traceId}, parentId=%X{parentId}, spanId=%X{spanId}, sampled=%X{sampled} [%c{2.}] (%t) %s%e%n 7 | -------------------------------------------------------------------------------- /examples/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | io.quarkiverse.zeebe 4 | quarkus-zeebe-parent 5 | 999-SNAPSHOT 6 | ../pom.xml 7 | 8 | 4.0.0 9 | 10 | quarkus-zeebe-examples 11 | Quarkus - Zeebe - Examples 12 | Quarkus Zeebe examples 13 | pom 14 | 15 | 16 | base 17 | opentelemetry 18 | reactive 19 | 20 | 21 | -------------------------------------------------------------------------------- /examples/reactive/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | By default all job-worker are disabled. 4 | 5 | Start application 6 | ```shell 7 | quarkus dev 8 | ``` 9 | Reset counter 10 | ```shell 11 | curl http://localhost:8080/test/reset 12 | ``` 13 | Create a process instances 14 | ```shell 15 | curl http://localhost:8080/test/blocking-process 16 | ``` 17 | Available process are: 18 | * blocking-process 19 | * blocking-auto-process 20 | * uni-auto-process 21 | * completionStage-auto-process 22 | 23 | Enable job-worker for the process in the `application.properties`. 24 | Restart the application with `s` 25 | -------------------------------------------------------------------------------- /examples/reactive/src/main/java/io/quarkiverse/zeebe/examples/reactive/JobCounter.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.examples.reactive; 2 | 3 | import java.util.concurrent.atomic.AtomicInteger; 4 | 5 | import jakarta.enterprise.context.ApplicationScoped; 6 | 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | 10 | @ApplicationScoped 11 | public class JobCounter { 12 | 13 | private static final Logger log = LoggerFactory.getLogger(JobCounter.class); 14 | 15 | private AtomicInteger count = new AtomicInteger(); 16 | private long startTimestamp; 17 | private long endTimestamp; 18 | private long throughputMax = 0; 19 | 20 | public void reset() { 21 | count = new AtomicInteger(); 22 | startTimestamp = 0; 23 | endTimestamp = 0; 24 | throughputMax = 0; 25 | } 26 | 27 | public void inc() { 28 | init(); 29 | endTimestamp = System.currentTimeMillis(); 30 | int currentCount = count.addAndGet(1); 31 | log.info("...completed (" + currentCount + "). " + getThroughputInfoFor(currentCount)); 32 | } 33 | 34 | private String getThroughputInfoFor(int currentCount) { 35 | 36 | long timeDiff = (endTimestamp - startTimestamp) / 1000; 37 | 38 | if (timeDiff == 0) { 39 | return "Current throughput (jobs/s): " + currentCount; 40 | } else { 41 | long throughput = currentCount / timeDiff; 42 | if (throughput > throughputMax) { 43 | throughputMax = throughput; 44 | } 45 | return "Current throughput (jobs/s): " + throughput + ", Max: " + throughputMax; 46 | } 47 | } 48 | 49 | public void init() { 50 | if (startTimestamp == 0) { 51 | startTimestamp = System.currentTimeMillis(); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /examples/reactive/src/main/java/io/quarkiverse/zeebe/examples/reactive/Parameter.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.examples.reactive; 2 | 3 | import io.quarkus.runtime.annotations.RegisterForReflection; 4 | 5 | @RegisterForReflection 6 | public class Parameter { 7 | 8 | public String data; 9 | 10 | public String info; 11 | 12 | @Override 13 | public String toString() { 14 | return "Parameter{" + 15 | "data='" + data + '\'' + 16 | ", info='" + info + '\'' + 17 | '}'; 18 | } 19 | } -------------------------------------------------------------------------------- /examples/reactive/src/main/java/io/quarkiverse/zeebe/examples/reactive/ParametersJobWorker.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.examples.reactive; 2 | 3 | import java.util.UUID; 4 | 5 | import io.quarkiverse.zeebe.JobWorker; 6 | import io.quarkiverse.zeebe.Variable; 7 | import io.quarkiverse.zeebe.VariablesAsType; 8 | import io.quarkus.logging.Log; 9 | import io.smallrye.mutiny.Uni; 10 | 11 | public class ParametersJobWorker { 12 | 13 | @JobWorker(type = "create-param") 14 | public Uni createParam(@Variable("_info") String info) { 15 | Parameter p = new Parameter(); 16 | p.info = info; 17 | p.data = UUID.randomUUID().toString(); 18 | return Uni.createFrom().item(p); 19 | } 20 | 21 | @JobWorker(type = "update-param") 22 | public Uni updateParam(@VariablesAsType Parameter parameter) { 23 | parameter.data = "Hi, " + parameter.info; 24 | return Uni.createFrom().item(parameter); 25 | } 26 | 27 | @JobWorker(type = "info-param") 28 | public Uni infoParam(@VariablesAsType Parameter parameter) { 29 | Log.infof("%s", parameter); 30 | return Uni.createFrom().voidItem(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /examples/reactive/src/main/java/io/quarkiverse/zeebe/examples/reactive/TestJobWorker.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.examples.reactive; 2 | 3 | import java.util.concurrent.CompletionStage; 4 | 5 | import jakarta.inject.Inject; 6 | 7 | import org.eclipse.microprofile.rest.client.inject.RestClient; 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | 11 | import io.camunda.zeebe.client.api.response.ActivatedJob; 12 | import io.camunda.zeebe.client.api.worker.JobClient; 13 | import io.quarkiverse.zeebe.JobWorker; 14 | import io.smallrye.mutiny.Uni; 15 | 16 | public class TestJobWorker { 17 | 18 | private static final Logger log = LoggerFactory.getLogger(TestJobWorker.class); 19 | 20 | @Inject 21 | JobCounter counter; 22 | 23 | @Inject 24 | @RestClient 25 | TestRestClient restClient; 26 | 27 | private Uni test() { 28 | log.info("No waiting ..."); 29 | return Uni.createFrom().voidItem(); 30 | } 31 | 32 | @JobWorker(type = "completionStage-auto") 33 | public CompletionStage noneBlockAutoRestCall(final JobClient client, final ActivatedJob job) { 34 | counter.init(); 35 | log.info("Invoke REST call..."); 36 | return restClient.completionStage().thenApply(d -> { 37 | counter.inc(); 38 | return null; 39 | }); 40 | } 41 | 42 | @JobWorker(type = "uni-auto") 43 | public Uni uni(final JobClient client, final ActivatedJob job) { 44 | counter.init(); 45 | log.info("Invoke REST call..."); 46 | return test().onItem().call(() -> restClient.uni()).replaceWith(() -> { 47 | counter.inc(); 48 | return null; 49 | }); 50 | } 51 | 52 | @JobWorker(type = "blocking-auto") 53 | public void blockingAutoRestCall(final JobClient client, final ActivatedJob job) { 54 | counter.init(); 55 | log.info("Invoke REST call..."); 56 | String tmp = restClient.blocking(); 57 | counter.inc(); 58 | } 59 | 60 | @JobWorker(type = "blocking", autoComplete = false) 61 | public void blocking(final JobClient client, final ActivatedJob job) { 62 | counter.init(); 63 | log.info("Invoke REST call..."); 64 | String tmp = restClient.blocking(); 65 | client.newCompleteCommand(job.getKey()).send().join(); 66 | counter.inc(); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /examples/reactive/src/main/java/io/quarkiverse/zeebe/examples/reactive/TestRestClient.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.examples.reactive; 2 | 3 | import java.util.concurrent.CompletionStage; 4 | 5 | import jakarta.ws.rs.GET; 6 | import jakarta.ws.rs.Path; 7 | 8 | import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; 9 | 10 | import io.smallrye.mutiny.Uni; 11 | 12 | @Path("/test") 13 | @RegisterRestClient(configKey = "test") 14 | public interface TestRestClient { 15 | 16 | @GET 17 | CompletionStage completionStage(); 18 | 19 | @GET 20 | Uni uni(); 21 | 22 | @GET 23 | String blocking(); 24 | } 25 | -------------------------------------------------------------------------------- /examples/reactive/src/main/java/io/quarkiverse/zeebe/examples/reactive/TestRestController.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.examples.reactive; 2 | 3 | import jakarta.inject.Inject; 4 | import jakarta.ws.rs.GET; 5 | import jakarta.ws.rs.Path; 6 | import jakarta.ws.rs.PathParam; 7 | import jakarta.ws.rs.Produces; 8 | import jakarta.ws.rs.core.MediaType; 9 | import jakarta.ws.rs.core.Response; 10 | 11 | import org.slf4j.Logger; 12 | import org.slf4j.LoggerFactory; 13 | 14 | import io.camunda.zeebe.client.ZeebeClient; 15 | 16 | @Path("test") 17 | public class TestRestController { 18 | 19 | private static Logger log = LoggerFactory.getLogger(TestRestController.class); 20 | 21 | @Inject 22 | ZeebeClient client; 23 | 24 | @Inject 25 | JobCounter jobCounter; 26 | 27 | @GET 28 | @Path("reset") 29 | @Produces(MediaType.APPLICATION_JSON) 30 | public Response reset() { 31 | jobCounter.reset(); 32 | return Response.ok().build(); 33 | } 34 | 35 | @GET 36 | @Path("{name}") 37 | @Produces(MediaType.APPLICATION_JSON) 38 | public Response createInstances(@PathParam("name") String name) { 39 | log.info("Start process instances... '{}'", name); 40 | for (int i = 0; i < 500; i++) { 41 | client.newCreateInstanceCommand() 42 | .bpmnProcessId(name) 43 | .latestVersion() 44 | .send().join(); 45 | } 46 | log.info("...done"); 47 | return Response.ok().build(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /examples/reactive/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | quarkus.banner.enabled=false 2 | 3 | 4 | %dev.quarkus.mockserver.devservices.enabled=true 5 | %dev.quarkus.rest-client.test.url=${quarkus.mockserver.endpoint} 6 | 7 | %dev.quarkus.mockserver.devservices.config-file=src/test/resources/mockserver.properties 8 | %dev.quarkus.mockserver.devservices.config-dir=src/test/resources/mockserver 9 | 10 | %dev.quarkus.zeebe.client.workers.completionStage-auto.enabled=false 11 | %dev.quarkus.zeebe.client.workers.uni-auto.enabled=true 12 | %dev.quarkus.zeebe.client.workers.blocking-auto.enabled=true 13 | %dev.quarkus.zeebe.client.workers.blocking.enabled=false -------------------------------------------------------------------------------- /examples/reactive/src/main/resources/bpmn/blocking.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Flow_1encjs6 6 | 7 | 8 | 9 | Flow_1b6o1y5 10 | 11 | 12 | 13 | 14 | 15 | 16 | Flow_1encjs6 17 | Flow_1b6o1y5 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /examples/reactive/src/main/resources/bpmn/test-process.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Flow_1vywf7z 6 | 7 | 8 | 9 | Flow_1x5usvr 10 | 11 | 12 | 13 | 14 | 15 | 16 | Flow_1vywf7z 17 | Flow_1x5usvr 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /examples/reactive/src/test/resources/mockserver.properties: -------------------------------------------------------------------------------- 1 | mockserver.initializationJsonPath=/mockserver/*.json 2 | # watch changes in the file 3 | mockserver.watchInitializationJson=true 4 | 5 | 6 | # Certificate Generation 7 | # dynamically generated CA key pair (if they don't already exist in specified directory) 8 | mockserver.dynamicallyCreateCertificateAuthorityCertificate=true 9 | # save dynamically generated CA key pair in working directory 10 | mockserver.directoryToSaveDynamicSSLCertificate=. 11 | # certificate domain name (default "localhost") 12 | mockserver.sslCertificateDomainName=localhost 13 | # comma separated list of ip addresses for Subject Alternative Name domain names (default empty list) 14 | mockserver.sslSubjectAlternativeNameDomains=www.example.com,www.another.com 15 | # comma separated list of ip addresses for Subject Alternative Name ips (default empty list) 16 | mockserver.sslSubjectAlternativeNameIps=127.0.0.1 -------------------------------------------------------------------------------- /examples/reactive/src/test/resources/mockserver/test.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "2", 4 | "httpRequest": { 5 | "path": "/test" 6 | }, 7 | "httpResponse": { 8 | "body": { 9 | "type": "JSON", 10 | "json": { 11 | "key": "k1", 12 | "value": "v2" 13 | }, 14 | "contentType": "application/json" 15 | }, 16 | "delay": { 17 | "timeUnit": "MILLISECONDS", 18 | "value": 100 19 | } 20 | } 21 | } 22 | ] -------------------------------------------------------------------------------- /integration-tests/bpmn/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | io.quarkiverse.zeebe 4 | quarkus-zeebe-integration-tests 5 | 999-SNAPSHOT 6 | ../pom.xml 7 | 8 | 4.0.0 9 | 10 | quarkus-zeebe-integration-tests-bpmn 11 | Quarkus - Zeebe - Integration Tests - BPMN 12 | Quarkus Zeebe integration tests bpmn 13 | 14 | 15 | 16 | io.quarkiverse.zeebe 17 | quarkus-zeebe 18 | ${project.version} 19 | 20 | 21 | io.quarkus 22 | quarkus-rest 23 | 24 | 25 | io.quarkus 26 | quarkus-rest-jackson 27 | 28 | 29 | io.quarkus 30 | quarkus-smallrye-health 31 | 32 | 33 | io.quarkus 34 | quarkus-micrometer-registry-prometheus 35 | 36 | 37 | io.quarkus 38 | quarkus-junit5 39 | test 40 | 41 | 42 | io.rest-assured 43 | rest-assured 44 | test 45 | 46 | 47 | org.awaitility 48 | awaitility 49 | test 50 | 51 | 52 | io.quarkiverse.zeebe 53 | quarkus-zeebe-test 54 | ${project.version} 55 | test 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/main/java/io/quarkiverse/zeebe/it/bpmn/TestClientInterceptor.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn; 2 | 3 | import jakarta.enterprise.context.ApplicationScoped; 4 | 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | 8 | import io.grpc.CallOptions; 9 | import io.grpc.Channel; 10 | import io.grpc.ClientCall; 11 | import io.grpc.MethodDescriptor; 12 | import io.quarkiverse.zeebe.ZeebeClientInterceptor; 13 | 14 | @ApplicationScoped 15 | public class TestClientInterceptor implements ZeebeClientInterceptor { 16 | 17 | static Logger log = LoggerFactory.getLogger(TestClientInterceptor.class); 18 | 19 | @Override 20 | public ClientCall interceptCall(MethodDescriptor method, CallOptions callOptions, 21 | Channel next) { 22 | log.info("Client call: {}", method.getFullMethodName()); 23 | return next.newCall(method, callOptions); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/main/java/io/quarkiverse/zeebe/it/bpmn/errors/ErrorsJobWorker.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.errors; 2 | 3 | import io.camunda.zeebe.client.api.response.ActivatedJob; 4 | import io.camunda.zeebe.client.api.worker.JobClient; 5 | import io.quarkiverse.zeebe.JobWorker; 6 | import io.quarkiverse.zeebe.ZeebeBpmnError; 7 | 8 | public class ErrorsJobWorker { 9 | 10 | @JobWorker(type = "throw-zeebe-error") 11 | public void throwZeebeError() { 12 | throw new ZeebeBpmnError("error-code", "error-message"); 13 | } 14 | 15 | @JobWorker(type = "throw-runtime-exception") 16 | public void throwRuntimeException() { 17 | throw new RuntimeException("error-code"); 18 | } 19 | 20 | @JobWorker(type = "fail", autoComplete = false) 21 | public void fail(final JobClient client, final ActivatedJob job) { 22 | client.newFailCommand(job.getKey()) 23 | .retries(job.getRetries() - 1) 24 | .errorMessage("error message") 25 | .send().join(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/main/java/io/quarkiverse/zeebe/it/bpmn/gateway/GatewayJobWorker.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.gateway; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | import io.quarkiverse.zeebe.JobWorker; 7 | import io.quarkiverse.zeebe.VariablesAsType; 8 | 9 | public class GatewayJobWorker { 10 | 11 | private static final Logger log = LoggerFactory.getLogger(GatewayJobWorker.class); 12 | 13 | @JobWorker(type = "gateway-empty-data") 14 | public Parameter emptyData(@VariablesAsType Parameter p) { 15 | p.data = null; 16 | p.info = "empty data"; 17 | return p; 18 | } 19 | 20 | @JobWorker(type = "gateway-read-data") 21 | public Parameter readData(@VariablesAsType Input input) { 22 | log.info("{}", input); 23 | if (input.read) { 24 | Parameter p = new Parameter(); 25 | p.data = "read data"; 26 | return p; 27 | } 28 | return null; 29 | } 30 | 31 | @JobWorker(type = "gateway-show-data") 32 | public void showData(@VariablesAsType Parameter p) { 33 | log.info("Parameter {} / {}", p.data, p.info); 34 | } 35 | 36 | @JobWorker(type = "gateway-update-data") 37 | public Parameter updateData(@VariablesAsType Parameter p) { 38 | p.data = "update[" + p.data + "]"; 39 | p.info = "update data"; 40 | return p; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/main/java/io/quarkiverse/zeebe/it/bpmn/gateway/Input.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.gateway; 2 | 3 | import io.quarkus.runtime.annotations.RegisterForReflection; 4 | 5 | @RegisterForReflection 6 | public class Input { 7 | 8 | public boolean read; 9 | 10 | public String message; 11 | 12 | @Override 13 | public String toString() { 14 | return "Input{" + 15 | "read=" + read + 16 | ", message='" + message + '\'' + 17 | '}'; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/main/java/io/quarkiverse/zeebe/it/bpmn/gateway/Parameter.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.gateway; 2 | 3 | import io.quarkus.runtime.annotations.RegisterForReflection; 4 | 5 | @RegisterForReflection 6 | public class Parameter { 7 | 8 | public String data; 9 | 10 | public String info; 11 | } 12 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/main/java/io/quarkiverse/zeebe/it/bpmn/metrics/MetricsTestJobWorker.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.metrics; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | import io.camunda.zeebe.client.api.response.ActivatedJob; 7 | import io.quarkiverse.zeebe.JobWorker; 8 | import io.quarkiverse.zeebe.VariablesAsType; 9 | 10 | public class MetricsTestJobWorker { 11 | 12 | private static final Logger log = LoggerFactory.getLogger(MetricsTestJobWorker.class); 13 | 14 | @JobWorker(type = "metrics_test") 15 | public MetricsTestParameter ok(ActivatedJob job, @VariablesAsType MetricsTestParameter p) { 16 | log.info("Job: {}, Parameter: {}", job, p); 17 | p.message = "Ok"; 18 | return p; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/main/java/io/quarkiverse/zeebe/it/bpmn/metrics/MetricsTestParameter.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.metrics; 2 | 3 | import io.quarkus.runtime.annotations.RegisterForReflection; 4 | 5 | @RegisterForReflection 6 | public class MetricsTestParameter { 7 | 8 | public String name; 9 | 10 | public String message; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/main/java/io/quarkiverse/zeebe/it/bpmn/parameters/Parameter.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.parameters; 2 | 3 | import io.quarkus.runtime.annotations.RegisterForReflection; 4 | 5 | @RegisterForReflection 6 | public class Parameter { 7 | 8 | public String data; 9 | 10 | public String info; 11 | 12 | @Override 13 | public String toString() { 14 | return "Parameter{" + 15 | "data='" + data + '\'' + 16 | ", info='" + info + '\'' + 17 | '}'; 18 | } 19 | } -------------------------------------------------------------------------------- /integration-tests/bpmn/src/main/java/io/quarkiverse/zeebe/it/bpmn/sayhello/SayHelloBusinessService.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.sayhello; 2 | 3 | import jakarta.enterprise.context.ApplicationScoped; 4 | 5 | @ApplicationScoped 6 | public class SayHelloBusinessService { 7 | 8 | public String hello(String name) { 9 | return "Hi, " + name; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/main/java/io/quarkiverse/zeebe/it/bpmn/sayhello/SayHelloJobWorker.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.sayhello; 2 | 3 | import jakarta.inject.Inject; 4 | 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | 8 | import io.camunda.zeebe.client.api.response.ActivatedJob; 9 | import io.quarkiverse.zeebe.JobWorker; 10 | import io.quarkiverse.zeebe.VariablesAsType; 11 | 12 | public class SayHelloJobWorker { 13 | 14 | private static final Logger log = LoggerFactory.getLogger(SayHelloJobWorker.class); 15 | 16 | @Inject 17 | SayHelloBusinessService service; 18 | 19 | @JobWorker 20 | public SayHelloParameter hello_task(ActivatedJob job, @VariablesAsType SayHelloParameter p) { 21 | log.info("Job: {}, Parameter: {}", job, p); 22 | p.message = service.hello(p.name); 23 | return p; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/main/java/io/quarkiverse/zeebe/it/bpmn/sayhello/SayHelloParameter.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.sayhello; 2 | 3 | import io.quarkus.runtime.annotations.RegisterForReflection; 4 | 5 | @RegisterForReflection 6 | public class SayHelloParameter { 7 | 8 | public String name; 9 | 10 | public String message; 11 | 12 | @Override 13 | public String toString() { 14 | return "SayHelloParameter{" + 15 | "name='" + name + '\'' + 16 | ", message='" + message + '\'' + 17 | '}'; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/main/java/io/quarkiverse/zeebe/it/bpmn/sayhello/SayHelloRestController.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.sayhello; 2 | 3 | import jakarta.inject.Inject; 4 | import jakarta.ws.rs.*; 5 | import jakarta.ws.rs.core.MediaType; 6 | import jakarta.ws.rs.core.Response; 7 | 8 | import io.camunda.zeebe.client.ZeebeClient; 9 | import io.camunda.zeebe.client.api.response.ProcessInstanceEvent; 10 | 11 | @Path("say-hello") 12 | @Consumes(MediaType.APPLICATION_JSON) 13 | @Produces(MediaType.APPLICATION_JSON) 14 | public class SayHelloRestController { 15 | 16 | @Inject 17 | ZeebeClient client; 18 | 19 | @POST 20 | @Produces(MediaType.APPLICATION_JSON) 21 | public Response startProcessInstance(SayHelloParameter p) { 22 | 23 | ProcessInstanceEvent event = client 24 | .newCreateInstanceCommand() 25 | .bpmnProcessId("hello_process") 26 | .latestVersion() 27 | .variables(p) 28 | .send().join(); 29 | 30 | return Response.ok(event).build(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | quarkus.banner.enabled=false 2 | quarkus.zeebe.health.enabled=true 3 | quarkus.http.test-port=0 4 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/main/resources/bpmn/errors/fail.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Flow_09ukqsf 6 | 7 | 8 | 9 | Flow_0p6iw0y 10 | 11 | 12 | 13 | 14 | 15 | 16 | Flow_09ukqsf 17 | Flow_0p6iw0y 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/main/resources/bpmn/ht.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Flow_1rvhc7f 6 | 7 | 8 | Human task test 9 | Flow_1rvhc7f 10 | Flow_0viyfr2 11 | 12 | 13 | 14 | Flow_0viyfr2 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/test/java/io/quarkiverse/zeebe/it/bpmn/AbstractTest.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn; 2 | 3 | import io.quarkiverse.zeebe.test.ZeebeTestResource; 4 | import io.quarkus.test.common.QuarkusTestResource; 5 | import io.restassured.RestAssured; 6 | 7 | @QuarkusTestResource(ZeebeTestResource.class) 8 | public class AbstractTest { 9 | 10 | //Configure the containers for the test 11 | static { 12 | RestAssured.enableLoggingOfRequestAndResponseIfValidationFails(); 13 | // RestAssured.filters(new ResponseLoggingFilter()); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/test/java/io/quarkiverse/zeebe/it/bpmn/errors/ErrorsIT.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.errors; 2 | 3 | import io.quarkus.test.junit.QuarkusIntegrationTest; 4 | 5 | @QuarkusIntegrationTest 6 | public class ErrorsIT extends ErrorsTest { 7 | } 8 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/test/java/io/quarkiverse/zeebe/it/bpmn/gateway/GatewayIT.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.gateway; 2 | 3 | import io.quarkus.test.junit.QuarkusIntegrationTest; 4 | 5 | @QuarkusIntegrationTest 6 | public class GatewayIT extends GatewayTest { 7 | } 8 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/test/java/io/quarkiverse/zeebe/it/bpmn/health/HealthCheckIT.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.health; 2 | 3 | import io.quarkus.test.junit.QuarkusIntegrationTest; 4 | 5 | @QuarkusIntegrationTest 6 | public class HealthCheckIT extends HealthCheckTest { 7 | } 8 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/test/java/io/quarkiverse/zeebe/it/bpmn/health/HealthCheckTest.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.health; 2 | 3 | import static io.restassured.RestAssured.given; 4 | 5 | import java.util.List; 6 | 7 | import jakarta.ws.rs.core.MediaType; 8 | import jakarta.ws.rs.core.Response; 9 | 10 | import org.junit.jupiter.api.Assertions; 11 | import org.junit.jupiter.api.DisplayName; 12 | import org.junit.jupiter.api.Test; 13 | 14 | import io.quarkiverse.zeebe.it.bpmn.AbstractTest; 15 | import io.quarkus.test.junit.QuarkusTest; 16 | import io.restassured.path.json.JsonPath; 17 | 18 | @QuarkusTest 19 | @DisplayName("Health check test") 20 | public class HealthCheckTest extends AbstractTest { 21 | 22 | @Test 23 | @DisplayName("Ready health check") 24 | public void readyHealthCheckTest() { 25 | JsonPath response = given() 26 | .when() 27 | .contentType(MediaType.APPLICATION_JSON) 28 | .get("/q/health/ready") 29 | .then() 30 | .statusCode(Response.Status.OK.getStatusCode()) 31 | .extract().jsonPath(); 32 | 33 | Assertions.assertEquals("UP", response.get("status")); 34 | List checks = response.getList("checks"); 35 | Assertions.assertNotNull(checks); 36 | Assertions.assertEquals(1, checks.size()); 37 | } 38 | 39 | @Test 40 | @DisplayName("Live health check") 41 | public void liveHealthCheckTest() { 42 | JsonPath response = given() 43 | .when() 44 | .contentType(MediaType.APPLICATION_JSON) 45 | .get("/q/health/live") 46 | .then() 47 | .statusCode(Response.Status.OK.getStatusCode()) 48 | .extract().jsonPath(); 49 | 50 | Assertions.assertEquals("UP", response.get("status")); 51 | List checks = response.getList("checks"); 52 | Assertions.assertNotNull(checks); 53 | Assertions.assertEquals(1, checks.size()); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/test/java/io/quarkiverse/zeebe/it/bpmn/metrics/MetricsIT.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.metrics; 2 | 3 | import io.quarkus.test.junit.QuarkusIntegrationTest; 4 | 5 | @QuarkusIntegrationTest 6 | public class MetricsIT extends MetricsTest { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/test/java/io/quarkiverse/zeebe/it/bpmn/parameters/ParametersIT.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.parameters; 2 | 3 | import io.quarkiverse.zeebe.it.bpmn.sayhello.SayHelloTest; 4 | import io.quarkus.test.junit.QuarkusIntegrationTest; 5 | 6 | @QuarkusIntegrationTest 7 | public class ParametersIT extends SayHelloTest { 8 | } 9 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/test/java/io/quarkiverse/zeebe/it/bpmn/parameters/ParametersTest.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.parameters; 2 | 3 | import static java.util.concurrent.TimeUnit.SECONDS; 4 | import static org.awaitility.Awaitility.await; 5 | 6 | import org.junit.jupiter.api.Assertions; 7 | import org.junit.jupiter.api.DisplayName; 8 | import org.junit.jupiter.api.Test; 9 | 10 | import io.camunda.zeebe.client.ZeebeClient; 11 | import io.camunda.zeebe.client.api.response.ProcessInstanceEvent; 12 | import io.camunda.zeebe.process.test.assertions.BpmnAssert; 13 | import io.camunda.zeebe.process.test.assertions.ProcessInstanceAssert; 14 | import io.quarkiverse.zeebe.it.bpmn.AbstractTest; 15 | import io.quarkiverse.zeebe.test.InjectZeebeClient; 16 | import io.quarkus.test.junit.QuarkusTest; 17 | 18 | @QuarkusTest 19 | @DisplayName("Parameters Test") 20 | public class ParametersTest extends AbstractTest { 21 | 22 | private static final String BPM_PROCESS_ID = "ParametersProcessTest"; 23 | 24 | @InjectZeebeClient 25 | ZeebeClient client; 26 | 27 | @Test 28 | @DisplayName("Start process") 29 | public void sayHelloTest() { 30 | 31 | Parameter p = new Parameter(); 32 | p.info = "info-input"; 33 | p.data = "data-input"; 34 | 35 | ProcessInstanceEvent event = client 36 | .newCreateInstanceCommand() 37 | .bpmnProcessId(BPM_PROCESS_ID) 38 | .latestVersion() 39 | .variables(p) 40 | .send().join(); 41 | 42 | Assertions.assertEquals(BPM_PROCESS_ID, event.getBpmnProcessId()); 43 | 44 | ProcessInstanceAssert a = BpmnAssert.assertThat(event); 45 | await().atMost(15, SECONDS).untilAsserted(a::isCompleted); 46 | 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/test/java/io/quarkiverse/zeebe/it/bpmn/sayhello/SayHelloIT.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.sayhello; 2 | 3 | import io.quarkus.test.junit.QuarkusIntegrationTest; 4 | 5 | @QuarkusIntegrationTest 6 | public class SayHelloIT extends SayHelloTest { 7 | } 8 | -------------------------------------------------------------------------------- /integration-tests/bpmn/src/test/java/io/quarkiverse/zeebe/it/bpmn/sayhello/SayHelloTest.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.sayhello; 2 | 3 | import static io.restassured.RestAssured.given; 4 | import static java.util.concurrent.TimeUnit.SECONDS; 5 | import static org.awaitility.Awaitility.await; 6 | 7 | import org.junit.jupiter.api.DisplayName; 8 | import org.junit.jupiter.api.Test; 9 | 10 | import io.camunda.zeebe.process.test.assertions.BpmnAssert; 11 | import io.camunda.zeebe.process.test.assertions.ProcessInstanceAssert; 12 | import io.quarkiverse.zeebe.it.bpmn.AbstractTest; 13 | import io.quarkus.test.junit.QuarkusTest; 14 | import io.restassured.http.ContentType; 15 | 16 | @QuarkusTest 17 | @DisplayName("Say Hello Test") 18 | public class SayHelloTest extends AbstractTest { 19 | 20 | @Test 21 | @DisplayName("Start process") 22 | public void sayHelloTest() { 23 | 24 | SayHelloParameter p = new SayHelloParameter(); 25 | p.message = "message-test-example"; 26 | p.name = "name-test-input"; 27 | 28 | long processInstanceKey = given().contentType(ContentType.JSON) 29 | .body(p).when() 30 | .post("/say-hello") 31 | .then().log().body().extract() 32 | .jsonPath().getLong("processInstanceKey"); 33 | 34 | ProcessInstanceAssert a = new ProcessInstanceAssert(processInstanceKey, BpmnAssert.getRecordStream()); 35 | await().atMost(7, SECONDS).untilAsserted(a::isCompleted); 36 | a.hasVariableWithValue("name", "name-test-input"); 37 | a.hasVariableWithValue("message", "Hi, name-test-input"); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /integration-tests/docker/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | io.quarkiverse.zeebe 4 | quarkus-zeebe-integration-tests 5 | 999-SNAPSHOT 6 | ../pom.xml 7 | 8 | 4.0.0 9 | 10 | quarkus-zeebe-integration-tests-docker 11 | Quarkus - Zeebe - Integration Tests - Docker 12 | Quarkus Zeebe integration tests docker 13 | 14 | 15 | 16 | io.quarkiverse.zeebe 17 | quarkus-zeebe 18 | ${project.version} 19 | 20 | 21 | io.quarkus 22 | quarkus-container-image-docker 23 | 24 | 25 | io.quarkus 26 | quarkus-rest 27 | 28 | 29 | io.quarkus 30 | quarkus-rest-jackson 31 | 32 | 33 | io.quarkus 34 | quarkus-smallrye-health 35 | 36 | 37 | io.quarkus 38 | quarkus-junit5 39 | test 40 | 41 | 42 | io.rest-assured 43 | rest-assured 44 | test 45 | 46 | 47 | org.awaitility 48 | awaitility 49 | test 50 | 51 | 52 | io.quarkiverse.zeebe 53 | quarkus-zeebe-test 54 | ${project.version} 55 | test 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /integration-tests/docker/src/main/docker/Dockerfile.jvm: -------------------------------------------------------------------------------- 1 | FROM registry.access.redhat.com/ubi8/openjdk-17:1.19 2 | 3 | ENV LANGUAGE='en_US:en' 4 | 5 | 6 | # We make four distinct layers so if there are application changes the library layers can be re-used 7 | COPY --chown=185 target/quarkus-app/lib/ /deployments/lib/ 8 | COPY --chown=185 target/quarkus-app/*.jar /deployments/ 9 | COPY --chown=185 target/quarkus-app/app/ /deployments/app/ 10 | COPY --chown=185 target/quarkus-app/quarkus/ /deployments/quarkus/ 11 | 12 | EXPOSE 8080 13 | USER 185 14 | ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" 15 | ENV JAVA_APP_JAR="/deployments/quarkus-run.jar" 16 | 17 | ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ] -------------------------------------------------------------------------------- /integration-tests/docker/src/main/docker/Dockerfile.native: -------------------------------------------------------------------------------- 1 | FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9 2 | WORKDIR /work/ 3 | RUN chown 1001 /work \ 4 | && chmod "g+rwX" /work \ 5 | && chown 1001:root /work 6 | COPY --chown=1001:root target/*-runner /work/application 7 | 8 | EXPOSE 8080 9 | USER 1001 10 | 11 | ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"] -------------------------------------------------------------------------------- /integration-tests/docker/src/main/java/io/quarkiverse/zeebe/it/docker/sayhello/SayHelloJobWorker.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.docker.sayhello; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | import io.camunda.zeebe.client.api.response.ActivatedJob; 7 | import io.camunda.zeebe.client.api.worker.JobClient; 8 | import io.quarkiverse.zeebe.JobWorker; 9 | import io.quarkiverse.zeebe.VariablesAsType; 10 | 11 | public class SayHelloJobWorker { 12 | 13 | private static final Logger log = LoggerFactory.getLogger(SayHelloJobWorker.class); 14 | 15 | @JobWorker(type = "hello_task") 16 | static public SayHelloParameter sayHello(JobClient client, ActivatedJob job, @VariablesAsType SayHelloParameter p) { 17 | log.info("Job: {}, Parameter: {}", job, p); 18 | p.message = "Hello " + p.name; 19 | return p; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /integration-tests/docker/src/main/java/io/quarkiverse/zeebe/it/docker/sayhello/SayHelloParameter.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.docker.sayhello; 2 | 3 | import io.quarkus.runtime.annotations.RegisterForReflection; 4 | 5 | @RegisterForReflection 6 | public class SayHelloParameter { 7 | 8 | public String name; 9 | 10 | public String message; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /integration-tests/docker/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | quarkus.banner.enabled=false 2 | quarkus.zeebe.health.enabled=true 3 | quarkus.http.test-port=0 4 | 5 | quarkus.container-image.build=true 6 | quarkus.container-image.tag=latest 7 | quarkus.container-image.group=quarkiverse -------------------------------------------------------------------------------- /integration-tests/docker/src/test/java/io/quarkiverse/zeebe/it/docker/AbstractTest.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.docker; 2 | 3 | import io.quarkiverse.zeebe.test.ZeebeTestResource; 4 | import io.quarkus.test.common.QuarkusTestResource; 5 | import io.restassured.RestAssured; 6 | import io.restassured.filter.log.ResponseLoggingFilter; 7 | 8 | @QuarkusTestResource(ZeebeTestResource.class) 9 | public class AbstractTest { 10 | 11 | //Configure the containers for the test 12 | static { 13 | RestAssured.enableLoggingOfRequestAndResponseIfValidationFails(); 14 | RestAssured.filters(new ResponseLoggingFilter()); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /integration-tests/docker/src/test/java/io/quarkiverse/zeebe/it/docker/sayhello/SayHelloIT.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.docker.sayhello; 2 | 3 | import io.quarkus.test.junit.QuarkusIntegrationTest; 4 | 5 | @QuarkusIntegrationTest 6 | public class SayHelloIT extends SayHelloTest { 7 | } 8 | -------------------------------------------------------------------------------- /integration-tests/docker/src/test/java/io/quarkiverse/zeebe/it/docker/sayhello/SayHelloTest.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.docker.sayhello; 2 | 3 | import static java.util.concurrent.TimeUnit.SECONDS; 4 | import static org.awaitility.Awaitility.await; 5 | 6 | import org.junit.jupiter.api.DisplayName; 7 | import org.junit.jupiter.api.Test; 8 | 9 | import io.camunda.zeebe.client.ZeebeClient; 10 | import io.camunda.zeebe.client.api.response.ProcessInstanceEvent; 11 | import io.camunda.zeebe.process.test.assertions.BpmnAssert; 12 | import io.camunda.zeebe.process.test.assertions.ProcessInstanceAssert; 13 | import io.quarkiverse.zeebe.it.docker.AbstractTest; 14 | import io.quarkiverse.zeebe.test.InjectZeebeClient; 15 | import io.quarkus.test.junit.QuarkusTest; 16 | 17 | @QuarkusTest 18 | @DisplayName("Say Hello Test") 19 | public class SayHelloTest extends AbstractTest { 20 | 21 | @InjectZeebeClient 22 | ZeebeClient client; 23 | 24 | @Test 25 | @DisplayName("Start process") 26 | public void sayHelloTest() { 27 | 28 | SayHelloParameter p = new SayHelloParameter(); 29 | p.message = "message-example"; 30 | p.name = "name-input"; 31 | 32 | ProcessInstanceEvent event = client 33 | .newCreateInstanceCommand() 34 | .bpmnProcessId("hello_process") 35 | .latestVersion() 36 | .variables(p) 37 | .send().join(); 38 | 39 | ProcessInstanceAssert a = BpmnAssert.assertThat(event); 40 | await().atMost(7, SECONDS).untilAsserted(a::isCompleted); 41 | a.hasVariableWithValue("name", "name-input"); 42 | a.hasVariableWithValue("message", "Hello name-input"); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /integration-tests/embedded/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | io.quarkiverse.zeebe 4 | quarkus-zeebe-integration-tests 5 | 999-SNAPSHOT 6 | ../pom.xml 7 | 8 | 4.0.0 9 | 10 | quarkus-zeebe-integration-tests-embedded 11 | Quarkus - Zeebe - Integration Tests - Embedded 12 | Quarkus Zeebe integration tests embedded 13 | 14 | 15 | 16 | io.quarkiverse.zeebe 17 | quarkus-zeebe 18 | ${project.version} 19 | 20 | 21 | io.quarkus 22 | quarkus-rest 23 | 24 | 25 | io.quarkus 26 | quarkus-rest-jackson 27 | 28 | 29 | io.quarkus 30 | quarkus-junit5 31 | test 32 | 33 | 34 | io.rest-assured 35 | rest-assured 36 | test 37 | 38 | 39 | org.awaitility 40 | awaitility 41 | test 42 | 43 | 44 | io.quarkiverse.zeebe 45 | quarkus-zeebe-test 46 | ${project.version} 47 | test 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /integration-tests/embedded/src/main/java/io/quarkiverse/zeebe/it/embedded/SayHelloBusinessService.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.embedded; 2 | 3 | import jakarta.enterprise.context.ApplicationScoped; 4 | 5 | @ApplicationScoped 6 | public class SayHelloBusinessService { 7 | 8 | public String hello(String name) { 9 | return "Hi, " + name; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /integration-tests/embedded/src/main/java/io/quarkiverse/zeebe/it/embedded/SayHelloJobWorker.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.embedded; 2 | 3 | import jakarta.inject.Inject; 4 | 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | 8 | import io.camunda.zeebe.client.api.response.ActivatedJob; 9 | import io.quarkiverse.zeebe.JobWorker; 10 | import io.quarkiverse.zeebe.VariablesAsType; 11 | 12 | public class SayHelloJobWorker { 13 | 14 | private static final Logger log = LoggerFactory.getLogger(SayHelloJobWorker.class); 15 | 16 | @Inject 17 | SayHelloBusinessService service; 18 | 19 | @JobWorker(type = "hello_task") 20 | public SayHelloParameter sayHello(ActivatedJob job, @VariablesAsType SayHelloParameter p) { 21 | log.info("Job: {}, Parameter: {}", job, p); 22 | p.message = service.hello(p.name); 23 | return p; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /integration-tests/embedded/src/main/java/io/quarkiverse/zeebe/it/embedded/SayHelloParameter.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.embedded; 2 | 3 | import io.quarkus.runtime.annotations.RegisterForReflection; 4 | 5 | @RegisterForReflection 6 | public class SayHelloParameter { 7 | 8 | public String name; 9 | 10 | public String message; 11 | 12 | @Override 13 | public String toString() { 14 | return "SayHelloParameter{" + 15 | "name='" + name + '\'' + 16 | ", message='" + message + '\'' + 17 | '}'; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /integration-tests/embedded/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | quarkus.banner.enabled=false 2 | quarkus.zeebe.devservices.enabled=false -------------------------------------------------------------------------------- /integration-tests/embedded/src/test/java/io/quarkiverse/zeebe/it/embedded/SayHelloEmbeddedIT.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.embedded; 2 | 3 | import io.quarkus.test.junit.QuarkusIntegrationTest; 4 | 5 | @QuarkusIntegrationTest 6 | public class SayHelloEmbeddedIT extends SayHelloEmbeddedTest { 7 | } 8 | -------------------------------------------------------------------------------- /integration-tests/noop/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | io.quarkiverse.zeebe 4 | quarkus-zeebe-integration-tests 5 | 999-SNAPSHOT 6 | ../pom.xml 7 | 8 | 4.0.0 9 | 10 | quarkus-zeebe-integration-tests-noop 11 | Quarkus - Zeebe - Integration Tests - NoOp 12 | Quarkus Zeebe integration tests noop 13 | 14 | 15 | 16 | io.quarkiverse.zeebe 17 | quarkus-zeebe 18 | ${project.version} 19 | 20 | 21 | io.quarkus 22 | quarkus-rest 23 | 24 | 25 | io.quarkus 26 | quarkus-rest-jackson 27 | 28 | 29 | io.quarkus 30 | quarkus-smallrye-health 31 | 32 | 33 | io.quarkus 34 | quarkus-micrometer-registry-prometheus 35 | 36 | 37 | io.quarkus 38 | quarkus-junit5 39 | test 40 | 41 | 42 | io.rest-assured 43 | rest-assured 44 | test 45 | 46 | 47 | org.awaitility 48 | awaitility 49 | test 50 | 51 | 52 | io.quarkiverse.zeebe 53 | quarkus-zeebe-test 54 | ${project.version} 55 | test 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /integration-tests/noop/src/main/java/io/quarkiverse/zeebe/it/bpmn/TestClientInterceptor.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn; 2 | 3 | import jakarta.enterprise.context.ApplicationScoped; 4 | 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | 8 | import io.grpc.CallOptions; 9 | import io.grpc.Channel; 10 | import io.grpc.ClientCall; 11 | import io.grpc.MethodDescriptor; 12 | import io.quarkiverse.zeebe.ZeebeClientInterceptor; 13 | 14 | @ApplicationScoped 15 | public class TestClientInterceptor implements ZeebeClientInterceptor { 16 | 17 | static Logger log = LoggerFactory.getLogger(TestClientInterceptor.class); 18 | 19 | @Override 20 | public ClientCall interceptCall(MethodDescriptor method, CallOptions callOptions, 21 | Channel next) { 22 | log.info("Client call: {}", method.getFullMethodName()); 23 | return next.newCall(method, callOptions); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /integration-tests/noop/src/main/java/io/quarkiverse/zeebe/it/bpmn/sayhello/SayHelloBusinessService.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.sayhello; 2 | 3 | import jakarta.enterprise.context.ApplicationScoped; 4 | 5 | @ApplicationScoped 6 | public class SayHelloBusinessService { 7 | 8 | public String hello(String name) { 9 | return "Hi, " + name; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /integration-tests/noop/src/main/java/io/quarkiverse/zeebe/it/bpmn/sayhello/SayHelloJobWorker.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.sayhello; 2 | 3 | import jakarta.inject.Inject; 4 | 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | 8 | import io.camunda.zeebe.client.api.response.ActivatedJob; 9 | import io.quarkiverse.zeebe.JobWorker; 10 | import io.quarkiverse.zeebe.VariablesAsType; 11 | 12 | public class SayHelloJobWorker { 13 | 14 | private static final Logger log = LoggerFactory.getLogger(SayHelloJobWorker.class); 15 | 16 | @Inject 17 | SayHelloBusinessService service; 18 | 19 | @JobWorker 20 | public SayHelloParameter hello_task(ActivatedJob job, @VariablesAsType SayHelloParameter p) { 21 | log.info("Job: {}, Parameter: {}", job, p); 22 | p.message = service.hello(p.name); 23 | return p; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /integration-tests/noop/src/main/java/io/quarkiverse/zeebe/it/bpmn/sayhello/SayHelloParameter.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.sayhello; 2 | 3 | import io.quarkus.runtime.annotations.RegisterForReflection; 4 | 5 | @RegisterForReflection 6 | public class SayHelloParameter { 7 | 8 | public String name; 9 | 10 | public String message; 11 | 12 | @Override 13 | public String toString() { 14 | return "SayHelloParameter{" + 15 | "name='" + name + '\'' + 16 | ", message='" + message + '\'' + 17 | '}'; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /integration-tests/noop/src/main/java/io/quarkiverse/zeebe/it/bpmn/sayhello/SayHelloRestController.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.sayhello; 2 | 3 | import jakarta.inject.Inject; 4 | import jakarta.ws.rs.*; 5 | import jakarta.ws.rs.core.MediaType; 6 | import jakarta.ws.rs.core.Response; 7 | 8 | import io.camunda.zeebe.client.ZeebeClient; 9 | import io.camunda.zeebe.client.api.response.ProcessInstanceEvent; 10 | 11 | @Path("say-hello") 12 | @Consumes(MediaType.APPLICATION_JSON) 13 | @Produces(MediaType.APPLICATION_JSON) 14 | public class SayHelloRestController { 15 | 16 | @Inject 17 | ZeebeClient client; 18 | 19 | @POST 20 | @Produces(MediaType.APPLICATION_JSON) 21 | public Response startProcessInstance(SayHelloParameter p) { 22 | 23 | ProcessInstanceEvent event = client 24 | .newCreateInstanceCommand() 25 | .bpmnProcessId("hello_process") 26 | .latestVersion() 27 | .variables(p) 28 | .send().join(); 29 | 30 | return Response.ok(event).build(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /integration-tests/noop/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | quarkus.banner.enabled=false 2 | quarkus.zeebe.health.enabled=true 3 | quarkus.http.test-port=0 4 | 5 | %dev.quarkus.zeebe.active=false 6 | %dev.quarkus.zeebe.devservices.enabled=false 7 | 8 | %test.quarkus.zeebe.active=false 9 | %test.quarkus.zeebe.devservices.enabled=false 10 | 11 | quarkus.test.integration-test-profile=test -------------------------------------------------------------------------------- /integration-tests/noop/src/test/java/io/quarkiverse/zeebe/it/bpmn/AbstractTest.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn; 2 | 3 | import io.quarkiverse.zeebe.test.ZeebeTestResource; 4 | import io.quarkus.test.common.QuarkusTestResource; 5 | import io.restassured.RestAssured; 6 | 7 | @QuarkusTestResource(ZeebeTestResource.class) 8 | public class AbstractTest { 9 | 10 | //Configure the containers for the test 11 | static { 12 | RestAssured.enableLoggingOfRequestAndResponseIfValidationFails(); 13 | // RestAssured.filters(new ResponseLoggingFilter()); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /integration-tests/noop/src/test/java/io/quarkiverse/zeebe/it/bpmn/sayhello/SayHelloIT.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.sayhello; 2 | 3 | import io.quarkus.test.junit.QuarkusIntegrationTest; 4 | 5 | @QuarkusIntegrationTest 6 | public class SayHelloIT extends SayHelloTest { 7 | } 8 | -------------------------------------------------------------------------------- /integration-tests/noop/src/test/java/io/quarkiverse/zeebe/it/bpmn/sayhello/SayHelloTest.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.bpmn.sayhello; 2 | 3 | import static io.restassured.RestAssured.given; 4 | 5 | import org.junit.jupiter.api.DisplayName; 6 | import org.junit.jupiter.api.Test; 7 | 8 | import io.quarkiverse.zeebe.it.bpmn.AbstractTest; 9 | import io.quarkus.test.junit.QuarkusTest; 10 | import io.restassured.http.ContentType; 11 | 12 | @QuarkusTest 13 | @DisplayName("Say Hello Test") 14 | public class SayHelloTest extends AbstractTest { 15 | 16 | @Test 17 | @DisplayName("Start process") 18 | public void sayHelloTest() { 19 | 20 | SayHelloParameter p = new SayHelloParameter(); 21 | p.message = "message-test-example"; 22 | p.name = "name-test-input"; 23 | 24 | long processInstanceKey = given().contentType(ContentType.JSON) 25 | .body(p).when() 26 | .post("/say-hello") 27 | .then().log().body().extract() 28 | .jsonPath().getLong("processInstanceKey"); 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /integration-tests/opentelemetry/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | io.quarkiverse.zeebe 4 | quarkus-zeebe-integration-tests 5 | 999-SNAPSHOT 6 | ../pom.xml 7 | 8 | 4.0.0 9 | 10 | quarkus-zeebe-integration-tests-opentelemetry 11 | Quarkus - Zeebe - Integration Tests - OpenTelemetry 12 | Quarkus Zeebe integration tests OpenTelemetry 13 | 14 | 15 | 16 | io.quarkiverse.zeebe 17 | quarkus-zeebe 18 | ${project.version} 19 | 20 | 21 | io.quarkus 22 | quarkus-rest 23 | 24 | 25 | io.quarkus 26 | quarkus-rest-jackson 27 | 28 | 29 | io.quarkus 30 | quarkus-opentelemetry 31 | 32 | 33 | io.quarkus 34 | quarkus-junit5 35 | test 36 | 37 | 38 | io.rest-assured 39 | rest-assured 40 | test 41 | 42 | 43 | org.awaitility 44 | awaitility 45 | test 46 | 47 | 48 | io.quarkiverse.zeebe 49 | quarkus-zeebe-test 50 | ${project.version} 51 | test 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /integration-tests/opentelemetry/src/main/java/io/quarkiverse/zeebe/it/opentelemetry/OpentelemetryTestJobWorker.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.opentelemetry; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | import io.camunda.zeebe.client.api.response.ActivatedJob; 7 | import io.quarkiverse.zeebe.JobWorker; 8 | import io.quarkiverse.zeebe.Variable; 9 | import io.quarkiverse.zeebe.VariablesAsType; 10 | 11 | public class OpentelemetryTestJobWorker { 12 | 13 | private static final Logger log = LoggerFactory.getLogger(OpentelemetryTestJobWorker.class); 14 | 15 | @JobWorker(type = "test") 16 | public Parameter openTelemetryTestMethod(ActivatedJob job, @VariablesAsType Parameter p, @Variable String name, 17 | @Variable String message) { 18 | log.info("Job: {}, Parameter: {}, name: {}, message: {}", job, p, name, message); 19 | p.message = "Ok"; 20 | return p; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /integration-tests/opentelemetry/src/main/java/io/quarkiverse/zeebe/it/opentelemetry/Parameter.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.opentelemetry; 2 | 3 | import io.quarkus.runtime.annotations.RegisterForReflection; 4 | 5 | @RegisterForReflection 6 | public class Parameter { 7 | 8 | public String name; 9 | 10 | public String message; 11 | 12 | @Override 13 | public String toString() { 14 | return "Parameter{" + 15 | "name='" + name + '\'' + 16 | ", message='" + message + '\'' + 17 | '}'; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /integration-tests/opentelemetry/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | quarkus.banner.enabled=false 2 | quarkus.zeebe.tracing.enabled=true 3 | 4 | quarkus.otel.exporter.otlp.traces.endpoint=http://localhost:4317 5 | -------------------------------------------------------------------------------- /integration-tests/opentelemetry/src/test/java/io/quarkiverse/zeebe/it/opentelemetry/OpentelemetryIT.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.opentelemetry; 2 | 3 | import org.junit.jupiter.api.DisplayName; 4 | 5 | import io.quarkus.test.junit.QuarkusIntegrationTest; 6 | 7 | @QuarkusIntegrationTest 8 | @DisplayName("Open-telemetry integration test") 9 | public class OpentelemetryIT extends OpentelemetryTest { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /integration-tests/opentelemetry/src/test/java/io/quarkiverse/zeebe/it/opentelemetry/TestResources.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.it.opentelemetry; 2 | 3 | import java.util.Collections; 4 | import java.util.Map; 5 | import java.util.Set; 6 | 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | import org.testcontainers.containers.GenericContainer; 10 | import org.testcontainers.containers.wait.strategy.HttpWaitStrategy; 11 | 12 | import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; 13 | 14 | public class TestResources implements QuarkusTestResourceLifecycleManager { 15 | 16 | private static final Logger log = LoggerFactory.getLogger(TestResources.class); 17 | 18 | public static String JAEGER_HOST; 19 | public static Integer JAEGER_PORT; 20 | 21 | GenericContainer jaeger = new GenericContainer<>("jaegertracing/all-in-one:1.58") 22 | .waitingFor(new BoundPortHttpWaitStrategy(16686)) 23 | .withEnv("COLLECTOR_OTLP_ENABLED", "true") 24 | .withExposedPorts(16686, 4317); 25 | 26 | @Override 27 | public Map start() { 28 | jaeger.start(); 29 | 30 | JAEGER_HOST = String.format("http://%s", jaeger.getHost()); 31 | JAEGER_PORT = jaeger.getMappedPort(16686); 32 | log.info("JAEGER_HOST: {}, JAEGER_PORT: {}", JAEGER_HOST, JAEGER_PORT); 33 | return Map.of("quarkus.otel.exporter.otlp.traces.endpoint", 34 | String.format("http://%s:%s", jaeger.getHost(), jaeger.getMappedPort(4317))); 35 | } 36 | 37 | @Override 38 | public void stop() { 39 | jaeger.stop(); 40 | } 41 | 42 | public static class BoundPortHttpWaitStrategy extends HttpWaitStrategy { 43 | private final int port; 44 | 45 | public BoundPortHttpWaitStrategy(int port) { 46 | this.port = port; 47 | } 48 | 49 | @Override 50 | protected Set getLivenessCheckPorts() { 51 | return Collections.singleton(this.waitStrategyTarget.getMappedPort(port)); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /integration-tests/panache/README.md: -------------------------------------------------------------------------------- 1 | 2 | ### Zeebe dev monitor 3 | 4 | Create new process instance in the `zeebe-dev-montor` with these variables 5 | ```json 6 | {"_name":"Test","_birth":"2001-08-16"} 7 | ``` 8 | 9 | `NoName` person 10 | ```json 11 | {"_name":"NoName","_birth":"2001-08-16"} 12 | ``` 13 | 14 | ### Curl 15 | 16 | Start process with curl for `Test` person 17 | ```shell 18 | curl http://localhost:8080/person -X POST -H 'Content-Type: application/json' -d '{"name":"Test-Curl","birth":"2001-08-16"}' 19 | ``` 20 | 21 | `NoName` person 22 | ```shell 23 | curl http://localhost:8080/person -X POST -H 'Content-Type: application/json' -d '{"name":"Test-Curl","birth":"2001-08-16"}' 24 | ``` -------------------------------------------------------------------------------- /integration-tests/panache/src/main/java/io/quarkiverse/zeebe/examples/panache/Person.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.examples.panache; 2 | 3 | import java.time.LocalDate; 4 | import java.util.UUID; 5 | 6 | import jakarta.persistence.Column; 7 | import jakarta.persistence.Entity; 8 | import jakarta.persistence.Id; 9 | 10 | @Entity 11 | public class Person { 12 | @Id 13 | @Column(name = "ID") 14 | public String id = UUID.randomUUID().toString(); 15 | @Column(name = "NAME") 16 | public String name; 17 | @Column(name = "BIRTH") 18 | public LocalDate birth; 19 | @Column(name = "AGE") 20 | public Integer age; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /integration-tests/panache/src/main/java/io/quarkiverse/zeebe/examples/panache/PersonJobWorker.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.examples.panache; 2 | 3 | import java.time.LocalDate; 4 | import java.time.Period; 5 | import java.util.Map; 6 | 7 | import jakarta.inject.Inject; 8 | import jakarta.transaction.Transactional; 9 | 10 | import io.quarkiverse.zeebe.JobWorker; 11 | import io.quarkiverse.zeebe.Variable; 12 | import io.quarkiverse.zeebe.VariablesAsType; 13 | 14 | public class PersonJobWorker { 15 | 16 | @Inject 17 | PersonRepository repository; 18 | 19 | @JobWorker(type = "createPerson") 20 | @Transactional 21 | public Person createPerson(@Variable("_name") String name, @Variable("_birth") LocalDate birth) { 22 | Person person = new Person(); 23 | person.birth = birth; 24 | person.name = name; 25 | repository.persistAndFlush(person); 26 | return person; 27 | } 28 | 29 | @JobWorker(type = "calculatePersonAge") 30 | public Map createPerson(@VariablesAsType Person person) { 31 | int age = Period.between(person.birth, LocalDate.now()).getYears(); 32 | return Map.of("_age", age); 33 | } 34 | 35 | @JobWorker(type = "updatePersonAge") 36 | @Transactional 37 | public Person updatePersonPairedYear(@Variable("_age") int age, @VariablesAsType Person person) { 38 | Person tmp = repository.findById(person.id); 39 | tmp.age = age; 40 | repository.persistAndFlush(tmp); 41 | return tmp; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /integration-tests/panache/src/main/java/io/quarkiverse/zeebe/examples/panache/PersonRepository.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.examples.panache; 2 | 3 | import jakarta.enterprise.context.ApplicationScoped; 4 | 5 | import io.quarkus.hibernate.orm.panache.PanacheRepositoryBase; 6 | 7 | @ApplicationScoped 8 | public class PersonRepository implements PanacheRepositoryBase { 9 | 10 | public Person findByName(String name) { 11 | return find("name", name).firstResult(); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /integration-tests/panache/src/main/java/io/quarkiverse/zeebe/examples/panache/PersonRestController.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.examples.panache; 2 | 3 | import java.time.LocalDate; 4 | import java.util.Map; 5 | 6 | import jakarta.inject.Inject; 7 | import jakarta.ws.rs.*; 8 | import jakarta.ws.rs.core.MediaType; 9 | import jakarta.ws.rs.core.Response; 10 | 11 | import io.camunda.zeebe.client.ZeebeClient; 12 | import io.camunda.zeebe.client.api.response.ProcessInstanceEvent; 13 | 14 | @Path("person") 15 | @Consumes(MediaType.APPLICATION_JSON) 16 | @Produces(MediaType.APPLICATION_JSON) 17 | public class PersonRestController { 18 | 19 | @Inject 20 | PersonRepository repository; 21 | 22 | @Inject 23 | ZeebeClient client; 24 | 25 | @POST 26 | public Response create(CreateRequestDTO dto) { 27 | 28 | Map data = Map.of( 29 | "_name", dto.name, 30 | "_birth", LocalDate.parse(dto.birth)); 31 | 32 | ProcessInstanceEvent event = client.newCreateInstanceCommand() 33 | .bpmnProcessId("person-process") 34 | .latestVersion() 35 | .variables(data) 36 | .send().join(); 37 | 38 | return Response.ok(event).build(); 39 | } 40 | 41 | @GET 42 | public Response findAll() { 43 | return Response.ok(repository.findAll().list()).build(); 44 | } 45 | 46 | @GET 47 | @Path("{id}") 48 | public Response findById(@PathParam("id") String id) { 49 | return Response.ok(repository.findById(id)).build(); 50 | } 51 | 52 | @GET 53 | @Path("{name}/name") 54 | public Response findByName(@PathParam("name") String name) { 55 | return Response.ok(repository.findByName(name)).build(); 56 | } 57 | 58 | public static class CreateRequestDTO { 59 | 60 | /** 61 | * name of the person 62 | */ 63 | public String name; 64 | 65 | /** 66 | * birth ISO string 2001-08-16 67 | */ 68 | public String birth; 69 | }; 70 | } 71 | -------------------------------------------------------------------------------- /integration-tests/panache/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | quarkus.banner.enabled=false 3 | 4 | quarkus.datasource.db-kind = postgresql 5 | quarkus.hibernate-orm.database.generation = drop-and-create 6 | 7 | %dev.quarkus.zeebe.devservices.monitor.enabled=true -------------------------------------------------------------------------------- /integration-tests/panache/src/test/java/io/quarkiverse/zeebe/examples/panache/PersonIT.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.examples.panache; 2 | 3 | import io.quarkus.test.junit.QuarkusIntegrationTest; 4 | 5 | @QuarkusIntegrationTest 6 | public class PersonIT extends PersonTest { 7 | } 8 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/CustomHeader.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe; 2 | 3 | import java.lang.annotation.*; 4 | 5 | @Target(ElementType.PARAMETER) 6 | @Retention(RetentionPolicy.RUNTIME) 7 | @Documented 8 | public @interface CustomHeader { 9 | 10 | String value() default ""; 11 | } -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/CustomHeaders.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe; 2 | 3 | import java.lang.annotation.*; 4 | 5 | @Target(ElementType.PARAMETER) 6 | @Retention(RetentionPolicy.RUNTIME) 7 | @Documented 8 | public @interface CustomHeaders { 9 | 10 | } -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/JobWorker.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe; 2 | 3 | import java.lang.annotation.*; 4 | 5 | @Retention(RetentionPolicy.RUNTIME) 6 | @Target({ ElementType.METHOD }) 7 | @Documented 8 | public @interface JobWorker { 9 | 10 | /** 11 | * Enable or disable the job worker. 12 | */ 13 | boolean enabled() default true; 14 | 15 | /** 16 | * Job type. 17 | * 18 | * @return type for which the JobHandler has to be registered 19 | */ 20 | String type() default ""; 21 | 22 | /** 23 | * Name of the job handler. 24 | * 25 | * @return name for zeebe job handler 26 | */ 27 | String name() default ""; 28 | 29 | /** 30 | * Job handler timeout 31 | * 32 | * @return job handler timeout 33 | */ 34 | long timeout() default -1L; 35 | 36 | /** 37 | * Maximum active jobs. 38 | * 39 | * @return maximum active jobs. 40 | */ 41 | int maxJobsActive() default -1; 42 | 43 | /** 44 | * Request timeout for the job 45 | * 46 | * @return request timeout for the job. 47 | */ 48 | long requestTimeout() default -1L; 49 | 50 | /** 51 | * Poll interval for the job worker. 52 | * 53 | * @return job poll interval. 54 | */ 55 | long pollInterval() default -1L; 56 | 57 | /** 58 | * List of fetch variables for the job. 59 | * 60 | * @return list of fetch variables for the job. 61 | */ 62 | String[] fetchVariables() default {}; 63 | 64 | /** 65 | * Fetch all variables for the job. 66 | * 67 | * @return disable or enable fetch all variables. 68 | */ 69 | boolean fetchAllVariables() default false; 70 | 71 | /** 72 | * Auto-complete enable or disable feature. 73 | * 74 | * @return the auto-complete enable or disable feature. 75 | */ 76 | boolean autoComplete() default true; 77 | 78 | } 79 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/JobWorkerExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe; 2 | 3 | import io.quarkiverse.zeebe.runtime.JobWorkerCommand; 4 | import io.quarkus.arc.Unremovable; 5 | 6 | @Unremovable 7 | public interface JobWorkerExceptionHandler { 8 | 9 | void handleError(JobWorkerCommand command, Throwable throwable); 10 | 11 | class WarningException extends RuntimeException { 12 | public WarningException(String message, Throwable cause) { 13 | super(message, cause); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/Variable.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe; 2 | 3 | import java.lang.annotation.*; 4 | 5 | @Target(ElementType.PARAMETER) 6 | @Retention(RetentionPolicy.RUNTIME) 7 | @Documented 8 | public @interface Variable { 9 | String value() default ""; 10 | } -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/VariablesAsType.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe; 2 | 3 | import java.lang.annotation.*; 4 | 5 | @Target(ElementType.PARAMETER) 6 | @Retention(RetentionPolicy.RUNTIME) 7 | @Documented 8 | public @interface VariablesAsType { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/ZeebeBpmnError.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe; 2 | 3 | public class ZeebeBpmnError extends RuntimeException { 4 | 5 | private String errorCode; 6 | private String errorMessage; 7 | 8 | public ZeebeBpmnError(String errorCode, String errorMessage) { 9 | super("[" + errorCode + "] " + errorMessage); 10 | this.errorCode = errorCode; 11 | this.errorMessage = errorMessage; 12 | } 13 | 14 | public String getErrorMessage() { 15 | return errorMessage; 16 | } 17 | 18 | public String getErrorCode() { 19 | return errorCode; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/ZeebeClientInterceptor.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe; 2 | 3 | import io.grpc.CallOptions; 4 | import io.grpc.Channel; 5 | import io.grpc.ClientCall; 6 | import io.grpc.MethodDescriptor; 7 | 8 | /** 9 | * Zeebe client interceptor qualifier for class which implements ZeebeClientInterceptor interface. 10 | * 11 | * @see io.grpc.ClientInterceptor 12 | */ 13 | public interface ZeebeClientInterceptor { 14 | 15 | ClientCall interceptCall( 16 | MethodDescriptor method, CallOptions callOptions, Channel next); 17 | } 18 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/ZeebeResourcesProducer.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe; 2 | 3 | import jakarta.enterprise.inject.Produces; 4 | import jakarta.inject.Singleton; 5 | 6 | import io.camunda.zeebe.client.api.JsonMapper; 7 | import io.camunda.zeebe.client.impl.ZeebeObjectMapper; 8 | import io.quarkus.arc.DefaultBean; 9 | import io.quarkus.arc.Unremovable; 10 | import io.smallrye.mutiny.infrastructure.Infrastructure; 11 | 12 | @Singleton 13 | public class ZeebeResourcesProducer { 14 | 15 | @Produces 16 | @Singleton 17 | @Unremovable 18 | @DefaultBean 19 | public JsonMapper defaultJsonMapper() { 20 | return new ZeebeObjectMapper(); 21 | } 22 | 23 | @Produces 24 | @Singleton 25 | @Unremovable 26 | @DefaultBean 27 | public ZeebeScheduledExecutorService defaultZeebeScheduledExecutorService() { 28 | return Infrastructure::getDefaultWorkerPool; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/ZeebeScheduledExecutorService.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe; 2 | 3 | import java.util.concurrent.ScheduledExecutorService; 4 | 5 | public interface ZeebeScheduledExecutorService { 6 | 7 | ScheduledExecutorService scheduledExecutorService(); 8 | } 9 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/JobWorkerMetadata.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime; 2 | 3 | public class JobWorkerMetadata { 4 | 5 | public JobWorkerValue workerValue; 6 | 7 | public String invokerClass; 8 | 9 | public String declaringClassName; 10 | 11 | public String methodName; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/JobWorkerValue.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime; 2 | 3 | import java.util.Arrays; 4 | 5 | public class JobWorkerValue { 6 | 7 | public boolean enabled; 8 | 9 | public String type; 10 | 11 | public String name; 12 | 13 | public long timeout; 14 | 15 | public int maxJobsActive; 16 | 17 | public long requestTimeout; 18 | 19 | public long pollInterval; 20 | 21 | public String[] fetchVariables; 22 | 23 | public boolean fetchAllVariables; 24 | 25 | public boolean autoComplete; 26 | 27 | @Override 28 | public String toString() { 29 | return "JobWorkerValue{" + 30 | "enabled=" + enabled + 31 | ", type='" + type + '\'' + 32 | ", name='" + name + '\'' + 33 | ", timeout=" + timeout + 34 | ", maxJobsActive=" + maxJobsActive + 35 | ", requestTimeout=" + requestTimeout + 36 | ", pollInterval=" + pollInterval + 37 | ", fetchVariables=" + Arrays.toString(fetchVariables) + 38 | ", fetchAllVariables=" + fetchAllVariables + 39 | ", autoComplete=" + autoComplete + 40 | '}'; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/ZeebeClientService.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime; 2 | 3 | import jakarta.enterprise.context.ApplicationScoped; 4 | import jakarta.enterprise.inject.Any; 5 | import jakarta.enterprise.inject.Instance; 6 | import jakarta.enterprise.inject.Produces; 7 | 8 | import org.jboss.logging.Logger; 9 | 10 | import io.camunda.zeebe.client.ZeebeClient; 11 | import io.camunda.zeebe.client.ZeebeClientBuilder; 12 | import io.camunda.zeebe.client.api.JsonMapper; 13 | import io.quarkiverse.zeebe.ZeebeClientInterceptor; 14 | import io.quarkiverse.zeebe.runtime.noop.NoOpZeebeClient; 15 | 16 | @ApplicationScoped 17 | public class ZeebeClientService { 18 | 19 | private static final Logger log = Logger.getLogger(ZeebeClientService.class); 20 | 21 | ZeebeClient client; 22 | 23 | public ZeebeClientService(ZeebeRuntimeConfig config, JsonMapper jsonMapper, 24 | @Any Instance interceptors) { 25 | if (config.active()) { 26 | log.infof("Creating new zeebe client for %s", config.client().broker().gatewayAddress()); 27 | ZeebeClientBuilder builder = ZeebeClientBuilderFactory.createBuilder(config.client(), jsonMapper); 28 | interceptors.forEach(x -> builder.withInterceptors(x::interceptCall)); 29 | client = builder.build(); 30 | } else { 31 | log.infof("Zeebe extension is disabled"); 32 | client = new NoOpZeebeClient(); 33 | } 34 | } 35 | 36 | @Produces 37 | public ZeebeClient client() { 38 | return client; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/ZeebeLifecycleManager.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime; 2 | 3 | import jakarta.enterprise.event.Observes; 4 | 5 | import io.camunda.zeebe.client.ZeebeClient; 6 | import io.quarkus.logging.Log; 7 | import io.quarkus.runtime.Shutdown; 8 | import io.quarkus.runtime.Startup; 9 | 10 | public class ZeebeLifecycleManager { 11 | 12 | // This method is used to eagerly create the zeebe bean instance at RUNTIME_INIT execution time. 13 | void onStartup(@Observes Startup event, ZeebeClient client) { 14 | client.getConfiguration(); 15 | } 16 | 17 | void onShutdown(@Observes Shutdown event, ZeebeClient client) { 18 | try { 19 | client.close(); 20 | } catch (Exception e) { 21 | Log.error("The shutdown of the Zeebe client failed", e); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/ZeebeRuntimeConfig.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime; 2 | 3 | import io.quarkus.runtime.annotations.ConfigPhase; 4 | import io.quarkus.runtime.annotations.ConfigRoot; 5 | import io.smallrye.config.ConfigMapping; 6 | import io.smallrye.config.WithDefault; 7 | import io.smallrye.config.WithName; 8 | 9 | @ConfigRoot(phase = ConfigPhase.RUN_TIME) 10 | @ConfigMapping(prefix = "quarkus.zeebe") 11 | public interface ZeebeRuntimeConfig { 12 | 13 | /** 14 | * Zeebe client broker configuration. 15 | */ 16 | @WithName("client") 17 | ZeebeClientRuntimeConfig client(); 18 | 19 | /** 20 | * Zeebe client is active 21 | */ 22 | @WithName("active") 23 | @WithDefault("true") 24 | boolean active(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/devmode/JobWorkerHotReplacementSetup.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.devmode; 2 | 3 | import java.util.concurrent.ExecutorService; 4 | import java.util.concurrent.Executors; 5 | 6 | import io.quarkus.dev.spi.HotReplacementContext; 7 | import io.quarkus.dev.spi.HotReplacementSetup; 8 | 9 | public class JobWorkerHotReplacementSetup implements HotReplacementSetup { 10 | 11 | private HotReplacementContext context; 12 | private static final long TWO_SECONDS = 2000; 13 | 14 | private volatile long nextUpdate; 15 | 16 | private final ExecutorService executor = Executors.newSingleThreadExecutor(); 17 | 18 | @Override 19 | public void setupHotDeployment(HotReplacementContext context) { 20 | this.context = context; 21 | JobWorkerReplacementInterceptor.onMessage(new OnMessage()); 22 | } 23 | 24 | @Override 25 | public void close() { 26 | executor.shutdown(); 27 | } 28 | 29 | private class OnMessage implements Runnable { 30 | 31 | @Override 32 | public void run() { 33 | if (nextUpdate < System.currentTimeMillis()) { 34 | synchronized (this) { 35 | if (nextUpdate < System.currentTimeMillis()) { 36 | executor.execute(() -> { 37 | try { 38 | context.doScan(true); 39 | } catch (RuntimeException e) { 40 | throw e; 41 | } catch (Exception e) { 42 | throw new RuntimeException(e); 43 | } 44 | }); 45 | // we update at most once every 2s 46 | nextUpdate = System.currentTimeMillis() + TWO_SECONDS; 47 | } 48 | } 49 | } 50 | } 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/devmode/JobWorkerReplacementInterceptor.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.devmode; 2 | 3 | import io.grpc.*; 4 | import io.quarkiverse.zeebe.ZeebeClientInterceptor; 5 | 6 | public class JobWorkerReplacementInterceptor implements ZeebeClientInterceptor { 7 | 8 | private static volatile Runnable onMessage; 9 | 10 | public static void onMessage(Runnable handler) { 11 | onMessage = handler; 12 | } 13 | 14 | @Override 15 | public ClientCall interceptCall(MethodDescriptor method, CallOptions callOptions, 16 | Channel next) { 17 | onMessage.run(); 18 | return next.newCall(method, callOptions); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/devmode/store/RecordStoreItem.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.devmode.store; 2 | 3 | import java.util.Map; 4 | 5 | import io.camunda.zeebe.protocol.record.Record; 6 | import io.camunda.zeebe.protocol.record.RecordValue; 7 | 8 | public record RecordStoreItem(Object id, Record record, Map data) { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/devmode/store/Store.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.devmode.store; 2 | 3 | import java.util.*; 4 | import java.util.concurrent.ConcurrentSkipListMap; 5 | import java.util.function.Function; 6 | import java.util.function.Predicate; 7 | import java.util.stream.Stream; 8 | 9 | import io.camunda.zeebe.protocol.record.Record; 10 | import io.camunda.zeebe.protocol.record.RecordValue; 11 | 12 | public class Store { 13 | 14 | private final Map> data = new ConcurrentSkipListMap<>(Collections.reverseOrder()); 15 | 16 | public static Store create() { 17 | return new Store<>(); 18 | } 19 | 20 | public RecordStoreItem putIfAbsent(Record record, Function, Object> f) { 21 | var id = f.apply(record); 22 | var item = get(id); 23 | if (item != null) { 24 | return null; 25 | } 26 | return put(id, record); 27 | } 28 | 29 | public RecordStoreItem put(Record record, Function, Object> f) { 30 | var id = f.apply(record); 31 | return put(id, record); 32 | } 33 | 34 | private RecordStoreItem put(Object id, Record record) { 35 | var item = createItem(id, record); 36 | var old = data.put(item.id(), item); 37 | if (old != null && !old.data().isEmpty()) { 38 | item.data().putAll(old.data()); 39 | } 40 | return item; 41 | } 42 | 43 | public Collection> values() { 44 | return data.values(); 45 | } 46 | 47 | public RecordStoreItem get(Object id) { 48 | return data.get(id); 49 | } 50 | 51 | public Optional> findFirstBy(Predicate> filter) { 52 | return data.values().stream().filter(x -> filter.test(x.record())).findFirst(); 53 | } 54 | 55 | public Stream> findBy(Predicate> filter) { 56 | return data.values().stream().filter(x -> filter.test(x.record())); 57 | } 58 | 59 | protected RecordStoreItem createItem(Object id, Record record) { 60 | return new RecordStoreItem<>(id, record, new HashMap<>()); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/devmode/store/UserTaskHeaders.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.devmode.store; 2 | 3 | public final class UserTaskHeaders { 4 | 5 | public static final String JOB_TYPE = "io.camunda.zeebe:userTask"; 6 | 7 | public static final String CANDIDATE_USERS = "io.camunda.zeebe:candidateUsers"; 8 | public static final String CANDIDATE_GROUPS = "io.camunda.zeebe:candidateGroups"; 9 | public static final String ASSIGNEE = "io.camunda.zeebe:assignee"; 10 | public static final String DUE_DATE = "io.camunda.zeebe:dueDate"; 11 | public static final String FOLLOW_UP_DATE = "io.camunda.zeebe:followUpDate"; 12 | } 13 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/graal/ConscryptSubstitutions.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.graal; 2 | 3 | import java.util.function.BooleanSupplier; 4 | 5 | import com.oracle.svm.core.annotate.Substitute; 6 | import com.oracle.svm.core.annotate.TargetClass; 7 | 8 | @TargetClass(className = "org.apache.hc.client5.http.ssl.ConscryptClientTlsStrategy", onlyWith = ConscryptMissingSelector.class) 9 | final class Target_org_apache_hc_client5_http_ssl_ConscryptClientTlsStrategy { 10 | 11 | @Substitute 12 | void applyParameters(final javax.net.ssl.SSLEngine sslEngine, final javax.net.ssl.SSLParameters sslParameters, 13 | final String[] appProtocols) { 14 | sslParameters.setApplicationProtocols(appProtocols); 15 | sslEngine.setSSLParameters(sslParameters); 16 | } 17 | 18 | @Substitute 19 | org.apache.hc.core5.reactor.ssl.TlsDetails createTlsDetails(final javax.net.ssl.SSLEngine sslEngine) { 20 | return null; 21 | } 22 | } 23 | 24 | final class ConscryptMissingSelector implements BooleanSupplier { 25 | 26 | @Override 27 | public boolean getAsBoolean() { 28 | try { 29 | Class.forName("org.conscrypt.Conscrypt"); 30 | return false; 31 | } catch (ClassNotFoundException e) { 32 | return true; 33 | } 34 | } 35 | } 36 | 37 | public class ConscryptSubstitutions { 38 | 39 | } 40 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/health/ZeebeHealthCheck.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.health; 2 | 3 | import java.util.List; 4 | import java.util.stream.Collectors; 5 | 6 | import jakarta.inject.Inject; 7 | 8 | import org.eclipse.microprofile.health.HealthCheck; 9 | import org.eclipse.microprofile.health.HealthCheckResponse; 10 | import org.eclipse.microprofile.health.HealthCheckResponseBuilder; 11 | import org.eclipse.microprofile.health.Readiness; 12 | 13 | import io.camunda.zeebe.client.ZeebeClient; 14 | import io.camunda.zeebe.client.api.command.ClientStatusException; 15 | import io.camunda.zeebe.client.api.response.BrokerInfo; 16 | import io.camunda.zeebe.client.api.response.Topology; 17 | 18 | @Readiness 19 | public class ZeebeHealthCheck implements HealthCheck { 20 | 21 | @Inject 22 | ZeebeClient client; 23 | 24 | @Override 25 | public HealthCheckResponse call() { 26 | HealthCheckResponseBuilder builder = HealthCheckResponse.named("Zeebe health check"); 27 | try { 28 | Topology topology = client.newTopologyRequest().send().join(); 29 | List brokers = topology.getBrokers(); 30 | if (brokers.isEmpty()) { 31 | return builder.withData("reason", "No brokers found").down().build(); 32 | } 33 | 34 | return builder 35 | .withData("brokers", brokers.stream().map(BrokerInfo::getAddress).collect(Collectors.joining(", "))) 36 | .withData("version", topology.getGatewayVersion()) 37 | .withData("size", topology.getClusterSize()) 38 | .withData("partitions", topology.getPartitionsCount()) 39 | .withData("replicationFactor", topology.getReplicationFactor()) 40 | .up() 41 | .build(); 42 | 43 | } catch (ClientStatusException e) { 44 | return builder.down() 45 | .withData("reason", e.getMessage()) 46 | .withData("code", e.getStatusCode().value()) 47 | .build(); 48 | } catch (Exception ex) { 49 | return builder.down().withData("reason", ex.getMessage()).build(); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/health/ZeebeTopologyHealthCheck.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.health; 2 | 3 | import jakarta.inject.Inject; 4 | 5 | import org.eclipse.microprofile.health.HealthCheck; 6 | import org.eclipse.microprofile.health.HealthCheckResponse; 7 | import org.eclipse.microprofile.health.HealthCheckResponseBuilder; 8 | import org.eclipse.microprofile.health.Liveness; 9 | 10 | import io.camunda.zeebe.client.ZeebeClient; 11 | import io.camunda.zeebe.client.api.command.ClientStatusException; 12 | import io.camunda.zeebe.client.api.response.Topology; 13 | 14 | @Liveness 15 | public class ZeebeTopologyHealthCheck implements HealthCheck { 16 | 17 | @Inject 18 | ZeebeClient client; 19 | 20 | @Override 21 | public HealthCheckResponse call() { 22 | HealthCheckResponseBuilder builder = HealthCheckResponse.named("Zeebe topology health check"); 23 | try { 24 | Topology topology = client.newTopologyRequest().send().join(); 25 | if (topology.getClusterSize() > 0) { 26 | return builder.up().build(); 27 | } 28 | return builder.down().withData("reason", "No brokers found").build(); 29 | } catch (ClientStatusException e) { 30 | return builder.down() 31 | .withData("reason", e.getMessage()) 32 | .withData("code", e.getStatusCode().value()) 33 | .build(); 34 | } catch (Exception ex) { 35 | return builder.down().withData("reason", ex.getMessage()).build(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/metrics/MetricsRecorder.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.metrics; 2 | 3 | public interface MetricsRecorder { 4 | 5 | String METRIC_NAME_JOB = "camunda.job.invocations"; 6 | String ACTION_ACTIVATED = "activated"; 7 | String ACTION_COMPLETED = "completed"; 8 | String ACTION_FAILED = "failed"; 9 | 10 | String ACTION_COMPLETED_FAILED = "completed-failed"; 11 | 12 | String ACTION_BPMN_ERROR_FAILED = "bpmn-error-failed"; 13 | 14 | String ACTION_BPMN_ERROR = "bpmn-error"; 15 | 16 | void increase(String name, String action, String type); 17 | 18 | void executeWithTimer(String name, Runnable method); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/metrics/MicrometerMetricsRecorder.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.metrics; 2 | 3 | import jakarta.enterprise.context.ApplicationScoped; 4 | import jakarta.inject.Inject; 5 | 6 | import io.micrometer.core.instrument.MeterRegistry; 7 | 8 | @ApplicationScoped 9 | public class MicrometerMetricsRecorder implements MetricsRecorder { 10 | @Inject 11 | MeterRegistry registry; 12 | 13 | @Override 14 | public void increase(String name, String action, String type) { 15 | registry.counter(name, "action", action, "type", type).increment(); 16 | } 17 | 18 | @Override 19 | public void executeWithTimer(String name, Runnable method) { 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/metrics/NoopMetricsRecorder.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.metrics; 2 | 3 | import jakarta.enterprise.context.ApplicationScoped; 4 | 5 | @ApplicationScoped 6 | public class NoopMetricsRecorder implements MetricsRecorder { 7 | 8 | @Override 9 | public void increase(String name, String action, String type) { 10 | 11 | } 12 | 13 | @Override 14 | public void executeWithTimer(String name, Runnable method) { 15 | method.run(); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/AbstractStep.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import java.time.Duration; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | 7 | import io.camunda.zeebe.client.api.ZeebeFuture; 8 | import io.camunda.zeebe.client.api.command.FinalCommandStep; 9 | import io.camunda.zeebe.client.api.response.ModifyProcessInstanceResponse; 10 | import io.camunda.zeebe.client.api.response.Topology; 11 | import io.camunda.zeebe.client.impl.response.ModifyProcessInstanceResponseImpl; 12 | import io.camunda.zeebe.client.impl.response.TopologyImpl; 13 | import io.camunda.zeebe.gateway.protocol.GatewayOuterClass; 14 | 15 | public class AbstractStep { 16 | 17 | private static final Map, Object> DATA = new HashMap<>(); 18 | static { 19 | DATA.put(ModifyProcessInstanceResponse.class, 20 | new ModifyProcessInstanceResponseImpl(GatewayOuterClass.ModifyProcessInstanceResponse.getDefaultInstance())); 21 | DATA.put(Topology.class, new TopologyImpl(GatewayOuterClass.TopologyResponse.getDefaultInstance())); 22 | } 23 | 24 | protected T create() { 25 | return null; 26 | } 27 | 28 | protected ZeebeFuture createFuture() { 29 | return new ZeebeFutureImpl<>(create()); 30 | } 31 | 32 | protected FinalCommandStep createFinal() { 33 | return new FinalCommandStepImpl<>(create()); 34 | } 35 | 36 | public ZeebeFuture send() { 37 | return createFuture(); 38 | } 39 | 40 | public FinalCommandStep requestTimeout(Duration requestTimeout) { 41 | return createFinal(); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/ActivateJobsCommandStep1Impl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import java.time.Duration; 4 | import java.util.List; 5 | 6 | import io.camunda.zeebe.client.api.command.ActivateJobsCommandStep1; 7 | import io.camunda.zeebe.client.api.response.ActivateJobsResponse; 8 | 9 | public class ActivateJobsCommandStep1Impl extends AbstractStep 10 | implements ActivateJobsCommandStep1.ActivateJobsCommandStep3, ActivateJobsCommandStep1, 11 | ActivateJobsCommandStep1.ActivateJobsCommandStep2 { 12 | 13 | @Override 14 | public ActivateJobsCommandStep2 jobType(String jobType) { 15 | return this; 16 | } 17 | 18 | @Override 19 | public ActivateJobsCommandStep3 maxJobsToActivate(int maxJobsToActivate) { 20 | return this; 21 | } 22 | 23 | @Override 24 | public ActivateJobsCommandStep3 timeout(Duration timeout) { 25 | return this; 26 | } 27 | 28 | @Override 29 | public ActivateJobsCommandStep3 workerName(String workerName) { 30 | return this; 31 | } 32 | 33 | @Override 34 | public ActivateJobsCommandStep3 fetchVariables(List fetchVariables) { 35 | return this; 36 | } 37 | 38 | @Override 39 | public ActivateJobsCommandStep3 fetchVariables(String... fetchVariables) { 40 | return this; 41 | } 42 | 43 | @Override 44 | public ActivateJobsCommandStep3 tenantId(String tenantId) { 45 | return this; 46 | } 47 | 48 | @Override 49 | public ActivateJobsCommandStep3 tenantIds(List tenantIds) { 50 | return this; 51 | } 52 | 53 | @Override 54 | public ActivateJobsCommandStep3 tenantIds(String... tenantIds) { 55 | return this; 56 | } 57 | 58 | @Override 59 | protected ActivateJobsResponse create() { 60 | return List::of; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/AssignUserTaskCommandStep1Impl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import io.camunda.zeebe.client.api.command.AssignUserTaskCommandStep1; 4 | import io.camunda.zeebe.client.api.response.AssignUserTaskResponse; 5 | 6 | public class AssignUserTaskCommandStep1Impl extends AbstractStep implements AssignUserTaskCommandStep1 { 7 | 8 | @Override 9 | protected AssignUserTaskResponse create() { 10 | return new AssignUserTaskResponse() { 11 | }; 12 | } 13 | 14 | @Override 15 | public AssignUserTaskCommandStep1 action(String action) { 16 | return this; 17 | } 18 | 19 | @Override 20 | public AssignUserTaskCommandStep1 assignee(String assignee) { 21 | return this; 22 | } 23 | 24 | @Override 25 | public AssignUserTaskCommandStep1 allowOverride(boolean allowOverride) { 26 | return this; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/BroadcastSignalCommandStep1Impl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import java.io.InputStream; 4 | import java.util.Map; 5 | 6 | import io.camunda.zeebe.client.api.command.BroadcastSignalCommandStep1; 7 | import io.camunda.zeebe.client.api.response.BroadcastSignalResponse; 8 | import io.camunda.zeebe.client.impl.response.BroadcastSignalResponseImpl; 9 | import io.camunda.zeebe.gateway.protocol.GatewayOuterClass; 10 | 11 | public class BroadcastSignalCommandStep1Impl extends AbstractStep 12 | implements BroadcastSignalCommandStep1.BroadcastSignalCommandStep2, BroadcastSignalCommandStep1 { 13 | @Override 14 | public BroadcastSignalCommandStep2 signalName(String signalName) { 15 | return this; 16 | } 17 | 18 | @Override 19 | public BroadcastSignalCommandStep2 variables(InputStream variables) { 20 | return this; 21 | } 22 | 23 | @Override 24 | public BroadcastSignalCommandStep2 variables(String variables) { 25 | return this; 26 | } 27 | 28 | @Override 29 | public BroadcastSignalCommandStep2 variables(Map variables) { 30 | return this; 31 | } 32 | 33 | @Override 34 | public BroadcastSignalCommandStep2 variables(Object variables) { 35 | return this; 36 | } 37 | 38 | @Override 39 | public BroadcastSignalCommandStep2 variable(String key, Object value) { 40 | return this; 41 | } 42 | 43 | @Override 44 | public BroadcastSignalCommandStep2 tenantId(String tenantId) { 45 | return this; 46 | } 47 | 48 | @Override 49 | protected BroadcastSignalResponse create() { 50 | return new BroadcastSignalResponseImpl(GatewayOuterClass.BroadcastSignalResponse.getDefaultInstance()); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/CancelProcessInstanceCommandStep1Impl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import io.camunda.zeebe.client.api.command.CancelProcessInstanceCommandStep1; 4 | import io.camunda.zeebe.client.api.response.CancelProcessInstanceResponse; 5 | import io.camunda.zeebe.client.impl.response.CancelProcessInstanceResponseImpl; 6 | import io.camunda.zeebe.gateway.protocol.GatewayOuterClass; 7 | 8 | public class CancelProcessInstanceCommandStep1Impl extends AbstractStep 9 | implements CancelProcessInstanceCommandStep1 { 10 | 11 | @Override 12 | protected CancelProcessInstanceResponse create() { 13 | return new CancelProcessInstanceResponseImpl(GatewayOuterClass.CancelProcessInstanceResponse.getDefaultInstance()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/CompleteJobCommandStep1Impl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import java.io.InputStream; 4 | import java.util.Map; 5 | 6 | import io.camunda.zeebe.client.api.command.CompleteJobCommandStep1; 7 | import io.camunda.zeebe.client.api.response.CompleteJobResponse; 8 | import io.camunda.zeebe.client.impl.response.CompleteJobResponseImpl; 9 | import io.camunda.zeebe.gateway.protocol.GatewayOuterClass; 10 | 11 | public class CompleteJobCommandStep1Impl extends AbstractStep implements CompleteJobCommandStep1 { 12 | @Override 13 | public CompleteJobCommandStep1 variables(InputStream variables) { 14 | return this; 15 | } 16 | 17 | @Override 18 | public CompleteJobCommandStep1 variables(String variables) { 19 | return this; 20 | } 21 | 22 | @Override 23 | public CompleteJobCommandStep1 variables(Map variables) { 24 | return this; 25 | } 26 | 27 | @Override 28 | public CompleteJobCommandStep1 variables(Object variables) { 29 | return this; 30 | } 31 | 32 | @Override 33 | public CompleteJobCommandStep1 variable(String key, Object value) { 34 | return this; 35 | } 36 | 37 | @Override 38 | protected CompleteJobResponse create() { 39 | return new CompleteJobResponseImpl(GatewayOuterClass.CompleteJobResponse.getDefaultInstance()); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/CompleteUserTaskCommandStep1Impl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import java.util.Map; 4 | 5 | import io.camunda.zeebe.client.api.command.CompleteUserTaskCommandStep1; 6 | import io.camunda.zeebe.client.api.response.CompleteUserTaskResponse; 7 | 8 | public class CompleteUserTaskCommandStep1Impl extends AbstractStep 9 | implements CompleteUserTaskCommandStep1 { 10 | 11 | @Override 12 | public CompleteUserTaskCommandStep1 action(String action) { 13 | return this; 14 | } 15 | 16 | @Override 17 | public CompleteUserTaskCommandStep1 variables(Map variables) { 18 | return this; 19 | } 20 | 21 | @Override 22 | protected CompleteUserTaskResponse create() { 23 | return new CompleteUserTaskResponse() { 24 | }; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/DeleteResourceCommandStep1Impl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import io.camunda.zeebe.client.api.command.DeleteResourceCommandStep1; 4 | import io.camunda.zeebe.client.api.response.DeleteResourceResponse; 5 | 6 | public class DeleteResourceCommandStep1Impl extends AbstractStep implements DeleteResourceCommandStep1 { 7 | 8 | @Override 9 | protected DeleteResourceResponse create() { 10 | return new DeleteResourceResponse() { 11 | }; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/DeployResourceCommandStep1Impl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import java.io.InputStream; 4 | import java.nio.charset.Charset; 5 | 6 | import io.camunda.zeebe.client.api.command.DeployResourceCommandStep1; 7 | import io.camunda.zeebe.client.api.response.*; 8 | import io.camunda.zeebe.client.impl.response.DeploymentEventImpl; 9 | import io.camunda.zeebe.gateway.protocol.GatewayOuterClass; 10 | import io.camunda.zeebe.model.bpmn.BpmnModelInstance; 11 | 12 | public class DeployResourceCommandStep1Impl extends AbstractStep 13 | implements DeployResourceCommandStep1, DeployResourceCommandStep1.DeployResourceCommandStep2 { 14 | 15 | @Override 16 | public DeployResourceCommandStep2 addResourceBytes(byte[] resourceBytes, String resourceName) { 17 | return this; 18 | } 19 | 20 | @Override 21 | public DeployResourceCommandStep2 addResourceString(String resourceString, Charset charset, String resourceName) { 22 | return this; 23 | } 24 | 25 | @Override 26 | public DeployResourceCommandStep2 addResourceStringUtf8(String resourceString, String resourceName) { 27 | return this; 28 | } 29 | 30 | @Override 31 | public DeployResourceCommandStep2 addResourceStream(InputStream resourceStream, String resourceName) { 32 | return this; 33 | } 34 | 35 | @Override 36 | public DeployResourceCommandStep2 addResourceFromClasspath(String classpathResource) { 37 | return this; 38 | } 39 | 40 | @Override 41 | public DeployResourceCommandStep2 addResourceFile(String filename) { 42 | return this; 43 | } 44 | 45 | @Override 46 | public DeployResourceCommandStep2 addProcessModel(BpmnModelInstance processDefinition, String resourceName) { 47 | return this; 48 | } 49 | 50 | @Override 51 | public DeploymentEvent create() { 52 | return new DeploymentEventImpl(GatewayOuterClass.DeployResourceResponse.getDefaultInstance()); 53 | } 54 | 55 | @Override 56 | public DeployResourceCommandStep2 tenantId(String tenantId) { 57 | return this; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/EvaluateDecisionCommandStep1Impl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import java.io.InputStream; 4 | import java.util.Map; 5 | 6 | import io.camunda.zeebe.client.api.command.EvaluateDecisionCommandStep1; 7 | import io.camunda.zeebe.client.api.response.EvaluateDecisionResponse; 8 | import io.camunda.zeebe.client.impl.ZeebeObjectMapper; 9 | import io.camunda.zeebe.client.impl.response.EvaluateDecisionResponseImpl; 10 | import io.camunda.zeebe.gateway.protocol.GatewayOuterClass; 11 | 12 | public class EvaluateDecisionCommandStep1Impl extends AbstractStep 13 | implements EvaluateDecisionCommandStep1, EvaluateDecisionCommandStep1.EvaluateDecisionCommandStep2 { 14 | @Override 15 | public EvaluateDecisionCommandStep2 decisionId(String decisionId) { 16 | return this; 17 | } 18 | 19 | @Override 20 | public EvaluateDecisionCommandStep2 decisionKey(long decisionKey) { 21 | return this; 22 | } 23 | 24 | @Override 25 | public EvaluateDecisionCommandStep2 variables(InputStream variables) { 26 | return this; 27 | } 28 | 29 | @Override 30 | public EvaluateDecisionCommandStep2 variables(String variables) { 31 | return this; 32 | } 33 | 34 | @Override 35 | public EvaluateDecisionCommandStep2 variables(Map variables) { 36 | return this; 37 | } 38 | 39 | @Override 40 | public EvaluateDecisionCommandStep2 variables(Object variables) { 41 | return this; 42 | } 43 | 44 | @Override 45 | public EvaluateDecisionCommandStep2 variable(String key, Object value) { 46 | return this; 47 | } 48 | 49 | @Override 50 | public EvaluateDecisionCommandStep2 tenantId(String tenantId) { 51 | return this; 52 | } 53 | 54 | @Override 55 | protected EvaluateDecisionResponse create() { 56 | return new EvaluateDecisionResponseImpl(new ZeebeObjectMapper(), 57 | GatewayOuterClass.EvaluateDecisionResponse.getDefaultInstance()); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/FailJobCommandStep1Impl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import java.io.InputStream; 4 | import java.time.Duration; 5 | import java.util.Map; 6 | 7 | import io.camunda.zeebe.client.api.command.FailJobCommandStep1; 8 | import io.camunda.zeebe.client.api.response.FailJobResponse; 9 | import io.camunda.zeebe.client.impl.response.FailJobResponseImpl; 10 | import io.camunda.zeebe.gateway.protocol.GatewayOuterClass; 11 | 12 | public class FailJobCommandStep1Impl extends AbstractStep 13 | implements FailJobCommandStep1.FailJobCommandStep2, FailJobCommandStep1 { 14 | 15 | @Override 16 | public FailJobCommandStep2 retries(int remainingRetries) { 17 | return this; 18 | } 19 | 20 | @Override 21 | public FailJobCommandStep2 retryBackoff(Duration backoffTimeout) { 22 | return this; 23 | } 24 | 25 | @Override 26 | public FailJobCommandStep2 errorMessage(String errorMsg) { 27 | return this; 28 | } 29 | 30 | @Override 31 | public FailJobCommandStep2 variables(InputStream variables) { 32 | return this; 33 | } 34 | 35 | @Override 36 | public FailJobCommandStep2 variables(String variables) { 37 | return this; 38 | } 39 | 40 | @Override 41 | public FailJobCommandStep2 variables(Map variables) { 42 | return this; 43 | } 44 | 45 | @Override 46 | public FailJobCommandStep2 variables(Object variables) { 47 | return this; 48 | } 49 | 50 | @Override 51 | public FailJobCommandStep2 variable(String key, Object value) { 52 | return this; 53 | } 54 | 55 | @Override 56 | protected FailJobResponse create() { 57 | return new FailJobResponseImpl(GatewayOuterClass.FailJobResponse.getDefaultInstance()); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/FinalCommandStepImpl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import java.time.Duration; 4 | 5 | import io.camunda.zeebe.client.api.ZeebeFuture; 6 | import io.camunda.zeebe.client.api.command.FinalCommandStep; 7 | 8 | public class FinalCommandStepImpl implements FinalCommandStep { 9 | 10 | private final T data; 11 | 12 | FinalCommandStepImpl(T data) { 13 | this.data = data; 14 | } 15 | 16 | @Override 17 | public FinalCommandStep requestTimeout(Duration requestTimeout) { 18 | return this; 19 | } 20 | 21 | @Override 22 | public ZeebeFuture send() { 23 | return new ZeebeFutureImpl<>(data); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/MigrateProcessInstanceCommandStep1Impl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import io.camunda.zeebe.client.api.command.MigrateProcessInstanceCommandStep1; 4 | import io.camunda.zeebe.client.api.command.MigrationPlan; 5 | import io.camunda.zeebe.client.api.response.MigrateProcessInstanceResponse; 6 | import io.camunda.zeebe.client.impl.response.MigrateProcessInstanceResponseImpl; 7 | import io.camunda.zeebe.gateway.protocol.GatewayOuterClass; 8 | 9 | public class MigrateProcessInstanceCommandStep1Impl extends AbstractStep 10 | implements MigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandFinalStep, 11 | MigrateProcessInstanceCommandStep1, MigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandStep2 { 12 | 13 | @Override 14 | public MigrateProcessInstanceCommandStep2 migrationPlan(long targetProcessDefinitionKey) { 15 | return this; 16 | } 17 | 18 | @Override 19 | public MigrateProcessInstanceCommandFinalStep migrationPlan(MigrationPlan migrationPlan) { 20 | return this; 21 | } 22 | 23 | @Override 24 | public MigrateProcessInstanceCommandFinalStep addMappingInstruction(String sourceElementId, String targetElementId) { 25 | return this; 26 | } 27 | 28 | @Override 29 | protected MigrateProcessInstanceResponse create() { 30 | return new MigrateProcessInstanceResponseImpl(GatewayOuterClass.MigrateProcessInstanceResponse.getDefaultInstance()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/PublishMessageCommandStep1Impl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import java.io.InputStream; 4 | import java.time.Duration; 5 | import java.util.Map; 6 | 7 | import io.camunda.zeebe.client.api.command.PublishMessageCommandStep1; 8 | import io.camunda.zeebe.client.api.response.PublishMessageResponse; 9 | import io.camunda.zeebe.client.impl.response.PublishMessageResponseImpl; 10 | import io.camunda.zeebe.gateway.protocol.GatewayOuterClass; 11 | 12 | public class PublishMessageCommandStep1Impl extends AbstractStep 13 | implements PublishMessageCommandStep1.PublishMessageCommandStep2, PublishMessageCommandStep1.PublishMessageCommandStep3, 14 | PublishMessageCommandStep1 { 15 | 16 | @Override 17 | public PublishMessageCommandStep2 messageName(String messageName) { 18 | return this; 19 | } 20 | 21 | @Override 22 | public PublishMessageCommandStep3 correlationKey(String correlationKey) { 23 | return this; 24 | } 25 | 26 | @Override 27 | public PublishMessageCommandStep3 withoutCorrelationKey() { 28 | return this; 29 | } 30 | 31 | @Override 32 | public PublishMessageCommandStep3 messageId(String messageId) { 33 | return this; 34 | } 35 | 36 | @Override 37 | public PublishMessageCommandStep3 timeToLive(Duration timeToLive) { 38 | return this; 39 | } 40 | 41 | @Override 42 | public PublishMessageCommandStep3 variables(InputStream variables) { 43 | return this; 44 | } 45 | 46 | @Override 47 | public PublishMessageCommandStep3 variables(String variables) { 48 | return this; 49 | } 50 | 51 | @Override 52 | public PublishMessageCommandStep3 variables(Map variables) { 53 | return this; 54 | } 55 | 56 | @Override 57 | public PublishMessageCommandStep3 variables(Object variables) { 58 | return this; 59 | } 60 | 61 | @Override 62 | public PublishMessageCommandStep3 variable(String key, Object value) { 63 | return this; 64 | } 65 | 66 | @Override 67 | public PublishMessageCommandStep3 tenantId(String tenantId) { 68 | return this; 69 | } 70 | 71 | @Override 72 | protected PublishMessageResponse create() { 73 | return new PublishMessageResponseImpl(GatewayOuterClass.PublishMessageResponse.getDefaultInstance()); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/ResolveIncidentCommandStep1Impl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import io.camunda.zeebe.client.api.command.ResolveIncidentCommandStep1; 4 | import io.camunda.zeebe.client.api.response.ResolveIncidentResponse; 5 | 6 | public class ResolveIncidentCommandStep1Impl extends AbstractStep 7 | implements ResolveIncidentCommandStep1 { 8 | 9 | @Override 10 | protected ResolveIncidentResponse create() { 11 | return new ResolveIncidentResponse() { 12 | }; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/SetVariablesCommandStep1Impl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import java.io.InputStream; 4 | import java.util.Map; 5 | 6 | import io.camunda.zeebe.client.api.command.SetVariablesCommandStep1; 7 | import io.camunda.zeebe.client.api.response.SetVariablesResponse; 8 | import io.camunda.zeebe.client.impl.response.SetVariablesResponseImpl; 9 | import io.camunda.zeebe.gateway.protocol.GatewayOuterClass; 10 | 11 | public class SetVariablesCommandStep1Impl extends AbstractStep 12 | implements SetVariablesCommandStep1, SetVariablesCommandStep1.SetVariablesCommandStep2 { 13 | 14 | @Override 15 | public SetVariablesCommandStep2 variables(InputStream variables) { 16 | return this; 17 | } 18 | 19 | @Override 20 | public SetVariablesCommandStep2 variables(String variables) { 21 | return this; 22 | } 23 | 24 | @Override 25 | public SetVariablesCommandStep2 variables(Map variables) { 26 | return this; 27 | } 28 | 29 | @Override 30 | public SetVariablesCommandStep2 variables(Object variables) { 31 | return this; 32 | } 33 | 34 | @Override 35 | public SetVariablesCommandStep2 local(boolean local) { 36 | return this; 37 | } 38 | 39 | @Override 40 | protected SetVariablesResponse create() { 41 | return new SetVariablesResponseImpl(GatewayOuterClass.SetVariablesResponse.getDefaultInstance()); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/StreamJobsCommandStep1Impl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import java.time.Duration; 4 | import java.util.List; 5 | import java.util.function.Consumer; 6 | 7 | import io.camunda.zeebe.client.api.command.StreamJobsCommandStep1; 8 | import io.camunda.zeebe.client.api.response.ActivatedJob; 9 | import io.camunda.zeebe.client.api.response.StreamJobsResponse; 10 | import io.camunda.zeebe.client.impl.response.StreamJobsResponseImpl; 11 | 12 | public class StreamJobsCommandStep1Impl extends AbstractStep implements 13 | StreamJobsCommandStep1.StreamJobsCommandStep3, StreamJobsCommandStep1, StreamJobsCommandStep1.StreamJobsCommandStep2 { 14 | 15 | @Override 16 | public StreamJobsCommandStep2 jobType(String jobType) { 17 | return this; 18 | } 19 | 20 | @Override 21 | public StreamJobsCommandStep3 consumer(Consumer consumer) { 22 | return this; 23 | } 24 | 25 | @Override 26 | public StreamJobsCommandStep3 timeout(Duration timeout) { 27 | return this; 28 | } 29 | 30 | @Override 31 | public StreamJobsCommandStep3 workerName(String workerName) { 32 | return this; 33 | } 34 | 35 | @Override 36 | public StreamJobsCommandStep3 fetchVariables(List fetchVariables) { 37 | return this; 38 | } 39 | 40 | @Override 41 | public StreamJobsCommandStep3 fetchVariables(String... fetchVariables) { 42 | return this; 43 | } 44 | 45 | @Override 46 | public StreamJobsCommandStep3 tenantId(String tenantId) { 47 | return this; 48 | } 49 | 50 | @Override 51 | public StreamJobsCommandStep3 tenantIds(List tenantIds) { 52 | return this; 53 | } 54 | 55 | @Override 56 | public StreamJobsCommandStep3 tenantIds(String... tenantIds) { 57 | return this; 58 | } 59 | 60 | @Override 61 | protected StreamJobsResponse create() { 62 | return new StreamJobsResponseImpl(); 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/ThrowErrorCommandStep1Impl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import java.io.InputStream; 4 | import java.util.Map; 5 | 6 | import io.camunda.zeebe.client.api.command.ThrowErrorCommandStep1; 7 | 8 | public class ThrowErrorCommandStep1Impl extends AbstractStep 9 | implements ThrowErrorCommandStep1, ThrowErrorCommandStep1.ThrowErrorCommandStep2 { 10 | 11 | @Override 12 | public ThrowErrorCommandStep2 errorCode(String errorCode) { 13 | return this; 14 | } 15 | 16 | @Override 17 | public ThrowErrorCommandStep2 errorMessage(String errorMsg) { 18 | return this; 19 | } 20 | 21 | @Override 22 | public ThrowErrorCommandStep2 variables(InputStream variables) { 23 | return this; 24 | } 25 | 26 | @Override 27 | public ThrowErrorCommandStep2 variables(String variables) { 28 | return this; 29 | } 30 | 31 | @Override 32 | public ThrowErrorCommandStep2 variables(Map variables) { 33 | return this; 34 | } 35 | 36 | @Override 37 | public ThrowErrorCommandStep2 variables(Object variables) { 38 | return this; 39 | } 40 | 41 | @Override 42 | public ThrowErrorCommandStep2 variable(String key, Object value) { 43 | return this; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/TopologyRequestStep1Impl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import io.camunda.zeebe.client.api.command.TopologyRequestStep1; 4 | import io.camunda.zeebe.client.api.response.Topology; 5 | import io.camunda.zeebe.client.impl.response.TopologyImpl; 6 | import io.camunda.zeebe.gateway.protocol.GatewayOuterClass; 7 | 8 | public class TopologyRequestStep1Impl extends AbstractStep implements TopologyRequestStep1 { 9 | 10 | @Override 11 | public TopologyRequestStep1 useRest() { 12 | return this; 13 | } 14 | 15 | @Override 16 | public TopologyRequestStep1 useGrpc() { 17 | return this; 18 | } 19 | 20 | @Override 21 | protected Topology create() { 22 | return new TopologyImpl(GatewayOuterClass.TopologyResponse.getDefaultInstance()); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/UnassignUserTaskCommandStep1Impl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import io.camunda.zeebe.client.api.command.UnassignUserTaskCommandStep1; 4 | import io.camunda.zeebe.client.api.response.UnassignUserTaskResponse; 5 | 6 | public class UnassignUserTaskCommandStep1Impl extends AbstractStep 7 | implements UnassignUserTaskCommandStep1 { 8 | 9 | @Override 10 | protected UnassignUserTaskResponse create() { 11 | return new UnassignUserTaskResponse() { 12 | }; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/UpdateRetriesJobCommandStep1Impl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import io.camunda.zeebe.client.api.command.UpdateRetriesJobCommandStep1; 4 | import io.camunda.zeebe.client.api.response.UpdateRetriesJobResponse; 5 | 6 | public class UpdateRetriesJobCommandStep1Impl extends AbstractStep 7 | implements UpdateRetriesJobCommandStep1, UpdateRetriesJobCommandStep1.UpdateRetriesJobCommandStep2 { 8 | 9 | @Override 10 | public UpdateRetriesJobCommandStep2 retries(int retries) { 11 | return this; 12 | } 13 | 14 | @Override 15 | protected UpdateRetriesJobResponse create() { 16 | return new UpdateRetriesJobResponse() { 17 | }; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/UpdateTimeoutJobCommandStep1Impl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import java.time.Duration; 4 | 5 | import io.camunda.zeebe.client.api.command.UpdateTimeoutJobCommandStep1; 6 | import io.camunda.zeebe.client.api.response.UpdateTimeoutJobResponse; 7 | 8 | public class UpdateTimeoutJobCommandStep1Impl extends AbstractStep 9 | implements UpdateTimeoutJobCommandStep1, UpdateTimeoutJobCommandStep1.UpdateTimeoutJobCommandStep2 { 10 | 11 | @Override 12 | public UpdateTimeoutJobCommandStep2 timeout(long timeout) { 13 | return this; 14 | } 15 | 16 | @Override 17 | public UpdateTimeoutJobCommandStep2 timeout(Duration timeout) { 18 | return this; 19 | } 20 | 21 | @Override 22 | protected UpdateTimeoutJobResponse create() { 23 | return new UpdateTimeoutJobResponse() { 24 | }; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/UpdateUserTaskCommandStep1Impl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import java.util.List; 4 | 5 | import io.camunda.zeebe.client.api.command.UpdateUserTaskCommandStep1; 6 | import io.camunda.zeebe.client.api.response.UpdateUserTaskResponse; 7 | 8 | public class UpdateUserTaskCommandStep1Impl extends AbstractStep implements UpdateUserTaskCommandStep1 { 9 | @Override 10 | public UpdateUserTaskCommandStep1 action(String action) { 11 | return this; 12 | } 13 | 14 | @Override 15 | public UpdateUserTaskCommandStep1 dueDate(String dueDate) { 16 | return this; 17 | } 18 | 19 | @Override 20 | public UpdateUserTaskCommandStep1 clearDueDate() { 21 | return this; 22 | } 23 | 24 | @Override 25 | public UpdateUserTaskCommandStep1 followUpDate(String followUpDate) { 26 | return this; 27 | } 28 | 29 | @Override 30 | public UpdateUserTaskCommandStep1 clearFollowUpDate() { 31 | return this; 32 | } 33 | 34 | @Override 35 | public UpdateUserTaskCommandStep1 candidateGroups(List candidateGroups) { 36 | return this; 37 | } 38 | 39 | @Override 40 | public UpdateUserTaskCommandStep1 candidateGroups(String... candidateGroups) { 41 | return this; 42 | } 43 | 44 | @Override 45 | public UpdateUserTaskCommandStep1 clearCandidateGroups() { 46 | return this; 47 | } 48 | 49 | @Override 50 | public UpdateUserTaskCommandStep1 candidateUsers(List candidateUsers) { 51 | return this; 52 | } 53 | 54 | @Override 55 | public UpdateUserTaskCommandStep1 candidateUsers(String... candidateUsers) { 56 | return this; 57 | } 58 | 59 | @Override 60 | public UpdateUserTaskCommandStep1 clearCandidateUsers() { 61 | return this; 62 | } 63 | 64 | @Override 65 | protected UpdateUserTaskResponse create() { 66 | return new UpdateUserTaskResponse() { 67 | }; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/noop/ZeebeFutureImpl.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.noop; 2 | 3 | import java.util.concurrent.TimeUnit; 4 | 5 | import io.camunda.zeebe.client.impl.http.HttpZeebeFuture; 6 | 7 | public class ZeebeFutureImpl extends HttpZeebeFuture { 8 | 9 | private final T response; 10 | 11 | public ZeebeFutureImpl(T response) { 12 | this.response = response; 13 | } 14 | 15 | @Override 16 | public T join() { 17 | return response; 18 | } 19 | 20 | @Override 21 | public T join(long timeout, TimeUnit unit) { 22 | return response; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/tracing/DefaultTracingRecorder.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.tracing; 2 | 3 | import java.util.Collection; 4 | 5 | import jakarta.enterprise.context.ApplicationScoped; 6 | 7 | import io.camunda.zeebe.client.api.response.ActivatedJob; 8 | 9 | @ApplicationScoped 10 | public class DefaultTracingRecorder implements TracingRecorder { 11 | 12 | private static final TracingRecorder.TracingContext CONTEXT = new TracingContext() { 13 | 14 | @Override 15 | public void error(String key, Throwable t) { 16 | 17 | } 18 | 19 | @Override 20 | public void close() { 21 | 22 | } 23 | 24 | @Override 25 | public void ok() { 26 | 27 | } 28 | }; 29 | 30 | @Override 31 | public Collection fields() { 32 | return null; 33 | } 34 | 35 | @Override 36 | public TracingContext createTracingContext(String clazz, String method, String name, ActivatedJob job) { 37 | return CONTEXT; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /runtime/src/main/java/io/quarkiverse/zeebe/runtime/tracing/TracingRecorder.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.runtime.tracing; 2 | 3 | import java.util.Collection; 4 | 5 | import io.camunda.zeebe.client.api.response.ActivatedJob; 6 | 7 | public interface TracingRecorder { 8 | 9 | TracingContext createTracingContext(String clazz, String method, String name, ActivatedJob job); 10 | 11 | Collection fields(); 12 | 13 | interface TracingContext { 14 | 15 | void error(String key, Throwable t); 16 | 17 | void close(); 18 | 19 | void ok(); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /runtime/src/main/resources/META-INF/quarkus-extension.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Zeebe" 3 | metadata: 4 | keywords: 5 | - "camunda" 6 | - "zeebe" 7 | - "bpmn" 8 | categories: 9 | - "business automation" 10 | -------------------------------------------------------------------------------- /runtime/src/main/resources/META-INF/services/io.quarkus.dev.spi.HotReplacementSetup: -------------------------------------------------------------------------------- 1 | io.quarkiverse.zeebe.runtime.devmode.JobWorkerHotReplacementSetup -------------------------------------------------------------------------------- /test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | io.quarkiverse.zeebe 5 | quarkus-zeebe-parent 6 | 999-SNAPSHOT 7 | ../pom.xml 8 | 9 | 4.0.0 10 | 11 | quarkus-zeebe-test 12 | Quarkus - Zeebe - Test 13 | Test Zeebe Camunda cloud BPMN workflow engine 14 | 15 | 16 | 17 | io.quarkiverse.zeebe 18 | quarkus-zeebe 19 | ${project.version} 20 | 21 | 22 | io.camunda 23 | zeebe-process-test-api 24 | 25 | 26 | io.camunda 27 | zeebe-process-test-assertions 28 | 29 | 30 | io.camunda 31 | zeebe-protocol-jackson 32 | 33 | 34 | io.camunda 35 | zeebe-process-test-engine 36 | 37 | 38 | io.quarkus 39 | quarkus-test-common 40 | 41 | 42 | io.zeebe 43 | zeebe-test-container 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /test/src/main/java/io/quarkiverse/zeebe/test/InjectZeebeClient.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.test; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Target(ElementType.FIELD) 10 | public @interface InjectZeebeClient { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/src/main/java/io/quarkiverse/zeebe/test/InjectZeebeTestEngine.java: -------------------------------------------------------------------------------- 1 | package io.quarkiverse.zeebe.test; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Target(ElementType.FIELD) 10 | public @interface InjectZeebeTestEngine { 11 | 12 | } 13 | --------------------------------------------------------------------------------