-
Notifications
You must be signed in to change notification settings - Fork 6
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
[Feature Request] Support multi-tenanted Zeebe workers #171
Comments
At the moment, the worker inherits the process environment You can override this by supplying a specific You really want a multi-tenanted worker? I had avoided supporting this scenario because it seems like you would want to enforce data segregation in the worker. We could make the How does that sound? |
This sounds great! Thank you! 🙂 Our use case for multi-tenanted workers is that many of our products have relatively similar BPMNs/jobs, with the only input difference being the tenantId when executed. We enforce segregation at the application-level via RLS and some other methods, so the worker itself is less of a concern. Thanks again! |
* feat(zeebe): add updateJobTimeout method fixes #171
@jwulf I think this was accidentally closed - the linked PR looks unrelated |
adds tenantIds: string[] to stream and polling worker config fixes #171
adds tenantIds: string[] to stream and polling worker config fixes #171
adds tenantIds: string[] to stream and polling worker config fixes #171
## [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)
Out in 8.6.1 |
Example use: client.createWorker({
taskHandler: (job) => {
console.log(job.tenantId) // '<default>' | 'green'
return job.complete()
},
taskType: 'multi-tenant-work',
tenantIds: ['<default>', 'green'],
})
client.streamJobs({
taskHandler: async (job) => {
console.log(job.tenantId) // '<default>' | 'green'
return job.complete()
},
type: 'multi-tenant-stream-work',
tenantIds: ['<default>', 'green'],
worker: 'stream-worker',
timeout: 2000,
}) |
## [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
Expected Behavior
When creating a Zeebe worker via
zeebe.createWorker
in a multi-tenanted environment, the worker options should accept a singletenantId
or an array oftenantIds
.Current Behavior
When creating a Zeebe worker via
zeebe.createWorker
, thetenantId
property is missing in the typings. Adding it anyway (ignoring Typescript), does work and allows the worker to be single-tenanted. However, the SDK only seems to support a single tenant.Possible Solution
Expose/create a
tenantIds
property on theZBWorkerBase
class, and update the following implementation that forces a single tenant: https://github.com/camunda/camunda-8-js-sdk/blob/main/src/zeebe/lib/ZBWorkerBase.ts#L563Steps to Reproduce
tenantId
into thezeebe.createWorker
options - the worker connects successfullyzeebe.createWorker
options with thetenantIds
property via an array, note it does not workContext (Environment)
While it's possible to force a worker to be single-tenanted (despite the missing type), it's not possible to have a worker multi-tenanted. Meaning, if multiple tenants share the same job, a separate worker must be created per tenant per job.
The text was updated successfully, but these errors were encountered: