-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Zeebe StreamActivatedJobs API #17
Comments
Hi @jwulf, do I assume correctly that this is targeted for 8.5 release? |
Hi @aleksander-dytko, it will probably soon come after the 8.5 release, asynchronously. There is a lot of work across the entire SDK for the 8.5 release. |
@jwulf @akeller do we know when this item will be delivered? I wanted to update the customer in the feature request |
This feature is under development, I estimate that it will be available at the end of May. In the meantime, would you be able to share the current worker creation parameters? There may be some tuning that can be done with the existing long polling that could mitigate the resource exhaustion. Some ideas that occur to me are to extend the long poll period, and also to add a randomised offset to it so that different workers that are started at the same time do not all poll at once. |
@aleksander-dytko an update on the status of this. This has been more challenging than I had anticipated. My revised time to deliver support for this feature in the JS SDK is the second week of June. |
At the moment, this feature fails in CI against both SM and SaaS. Example: https://github.com/camunda/camunda-8-js-sdk/actions/runs/9313149620 On my local machine, it fails or succeeds with no discernable pattern. I am using Wireshark to see if I can debug it at the network level. The stream is opened, but sometimes nothing comes over it locally. On CI, nothing comes over it. CI is running Ubuntu. Locally, I am running MacOS. I am installing Ubuntu locally to see what happens there. |
@pepopowitz and I paired on this today. This appears to be an issue with the underlying JS gRPC library. We haven't been able to isolate the circumstances surrounding the failure to get it to stably reproduce. Today, it worked for some time, and then started failing. I had thought that restarting the SM stack caused it to work for some time, but even that didn't work. Here is a network packet capture from Wireshark for the failing call from the JS client: The data packet that is being sent is an End Stream command. With GRPC trace debugging turned on, this is what happens: For some reason, the stream is terminated by the client immediately. Contrast this with the network capture of the same request from the Java client (working, and in parallel to the JS client): |
OK, I got it working outside the test suite. There seems to be some interaction in the way the test suite mechanics are wired up. |
* feat(zeebe): support StreamActivatedJobs RPC fixes #17 * test(zeebe): add inputVariableDto to test * refactor(zeebe): incorporate DTO decoding * test(zeebe): fix StreamJobs test * docs(zeebe): document StreamJobs * feat(zeebe): enable compression * test(zeebe): fix StreamJobs test * test(zeebe): add delay in StreamJobs test * test(zeebe): close Zeebe cllent in StreamJob test * fix(zeebe): cleanup Job Streams on close * feat(zeebe): return close method from StreamJobs
In the test, it needs a two second delay after starting the stream before starting a process instance. |
@aleksander-dytko support for the streaming jobs API is available in the latest packages: 8.5.5 and 8.6.0. Documentation: https://camunda.github.io/camunda-8-js-sdk/classes/index.Zeebe.ZeebeGrpcClient.html#streamJobs Here is a potential "gotcha" using this feature, documented in the README: Job StreamingThe Zeebe gRPC API supports streaming available jobs, rather than polling for them. The ZeebeGrpcClient method Please note that only jobs that become available after the stream is opened are pushed to the client. For jobs that were already activatable before the method is called, you need to use a polling worker. In this release, this is not handled for you. You must both poll and stream jobs to make sure that you get jobs that were available before your application started as well as jobs that become available after your application starts. In a subsequent release, the ZeebeWorker will transparently handle this for you. |
## [8.6.1-alpha.1](v8.6.0...v8.6.1-alpha.1) (2024-06-07) ### Features * **zeebe:** add multi-tenant support to workers ([#175](#175)) ([28450a5](28450a5)), closes [#171](#171) * **zeebe:** add updateJobTimeout method ([#172](#172)) ([5eff624](5eff624)), closes [#171](#171) * **zeebe:** support StreamActivatedJobs RPC ([#160](#160)) ([258296a](258296a)), closes [#17](#17)
## [8.6.1-alpha.1](v8.6.0...v8.6.1-alpha.1) (2024-06-07) ### Features * **zeebe:** add multi-tenant support to workers ([#175](#175)) ([28450a5](28450a5)), closes [#171](#171) * **zeebe:** add updateJobTimeout method ([#172](#172)) ([5eff624](5eff624)), closes [#171](#171) * **zeebe:** support StreamActivatedJobs RPC ([#160](#160)) ([258296a](258296a)), closes [#17](#17)
* feat(zeebe): add updateJobTimeout method (#172) * feat(zeebe): add updateJobTimeout method fixes #171 * feat(zeebe): support StreamActivatedJobs RPC (#160) * feat(zeebe): support StreamActivatedJobs RPC fixes #17 * test(zeebe): add inputVariableDto to test * refactor(zeebe): incorporate DTO decoding * test(zeebe): fix StreamJobs test * docs(zeebe): document StreamJobs * feat(zeebe): enable compression * test(zeebe): fix StreamJobs test * test(zeebe): add delay in StreamJobs test * test(zeebe): close Zeebe cllent in StreamJob test * fix(zeebe): cleanup Job Streams on close * feat(zeebe): return close method from StreamJobs * chore(release): 8.5.5-alpha.1 [skip ci] ## [8.5.5-alpha.1](v8.5.4...v8.5.5-alpha.1) (2024-06-05) ### Features * **zeebe:** add updateJobTimeout method ([#172](#172)) ([5eff624](5eff624)), closes [#171](#171) * **zeebe:** support StreamActivatedJobs RPC ([#160](#160)) ([258296a](258296a)), closes [#17](#17) * chore(release): 8.5.5-alpha.1 [skip ci] ## [8.5.5-alpha.1](v8.5.4...v8.5.5-alpha.1) (2024-06-05) ### Features * **zeebe:** add updateJobTimeout method ([#172](#172)) ([5eff624](5eff624)), closes [#171](#171) * **zeebe:** support StreamActivatedJobs RPC ([#160](#160)) ([258296a](258296a)), closes [#17](#17) * feat(zeebe): add multi-tenant support to workers (#175) adds tenantIds: string[] to stream and polling worker config fixes #171 * chore(release): 8.6.1-alpha.1 [skip ci] ## [8.6.1-alpha.1](v8.6.0...v8.6.1-alpha.1) (2024-06-07) ### Features * **zeebe:** add multi-tenant support to workers ([#175](#175)) ([28450a5](28450a5)), closes [#171](#171) * **zeebe:** add updateJobTimeout method ([#172](#172)) ([5eff624](5eff624)), closes [#171](#171) * **zeebe:** support StreamActivatedJobs RPC ([#160](#160)) ([258296a](258296a)), closes [#17](#17) * chore(release): 8.6.1-alpha.1 [skip ci] ## [8.6.1-alpha.1](v8.6.0...v8.6.1-alpha.1) (2024-06-07) ### Features * **zeebe:** add multi-tenant support to workers ([#175](#175)) ([28450a5](28450a5)), closes [#171](#171) * **zeebe:** add updateJobTimeout method ([#172](#172)) ([5eff624](5eff624)), closes [#171](#171) * **zeebe:** support StreamActivatedJobs RPC ([#160](#160)) ([258296a](258296a)), closes [#17](#17) * ci(repo): add dispatch workflow to actions --------- Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
## [8.6.2](v8.6.1...v8.6.2) (2024-06-12) ### Bug Fixes * **zeebe:** security fix for grpc-js dependency update ([#180](#180)) ([f43d956](f43d956)) ### Features * **zeebe:** add deployResources method ([165862f](165862f)), closes [#173](#173) * **zeebe:** add multi-tenant support to workers ([#175](#175)) ([28450a5](28450a5)), closes [#171](#171) * **zeebe:** add updateJobTimeout method ([#172](#172)) ([5eff624](5eff624)), closes [#171](#171) * **zeebe:** support StreamActivatedJobs RPC ([#160](#160)) ([258296a](258296a)), closes [#17](#17)
## [8.6.2](v8.6.1...v8.6.2) (2024-06-12) ### Bug Fixes * **zeebe:** security fix for grpc-js dependency update ([#180](#180)) ([f43d956](f43d956)) ### Features * **zeebe:** add deployResources method ([165862f](165862f)), closes [#173](#173) * **zeebe:** add multi-tenant support to workers ([#175](#175)) ([28450a5](28450a5)), closes [#171](#171) * **zeebe:** add updateJobTimeout method ([#172](#172)) ([5eff624](5eff624)), closes [#171](#171) * **zeebe:** support StreamActivatedJobs RPC ([#160](#160)) ([258296a](258296a)), closes [#17](#17)
SDK Component
Zeebe
The Zeebe Gateway has a new RPC StreamJobs to open a long-lived stream that essentially "pushes" jobs to the worker.
This obviates polling loops.
camunda/camunda#14152
Environment variable to enable it:
ZEEBE_CLIENT_WORKER_STREAMENABLED
See also the documentation about the general concept, including how back pressure works and can be implemented for your custom client: https://stage.docs.camunda.io/docs/next/components/concepts/job-workers/#job-streaming
The text was updated successfully, but these errors were encountered: