You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 8, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+12-1Lines changed: 12 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,20 @@
1
+
# Version v0.21
2
+
3
+
• Add long polling support. See [#64](https://github.com/creditsenseau/zeebe-client-node-js/issues/64).
4
+
• @TODO: Add authentication via JWT.
5
+
6
+
# Version v0.20
7
+
8
+
• Add TLS support (Thanks Colin from the Camunda Cloud Team!).
9
+
• Remove node-grpc-client dependency.
10
+
• Change versioning to match Broker versioning (Thanks Tim!).
11
+
1
12
# Version 2.4.0
2
13
3
14
• Update for Zeebe 0.18.
4
15
• Remove `ZBClient.listWorkflows` and `ZBClient.getWorkflow` - the broker no longer provides a query API.
5
16
• Remove `{redeploy: boolean}` option from `ZBClient.deployWorkflow` method. This relies on `listWorkflows`. This will be the default behaviour in a future release of Zeebe. See [zeebe/#1159](https://github.com/zeebe-io/zeebe/issues/1159).
6
-
• Add client-side retry logic. Retries ZBClient gRPC command methods on failure due to [gRPC error code 14](https://github.com/grpc/grpc/blob/master/doc/statuscodes.md) (Transient Network Error). See [#40](https://github.com/creditsenseau/zeebe-client-node-js/issues/40).
17
+
• Add client-side retry logic. Retries ZBClient gRPC command methods on failure due to [gRPC error code 14](https://github.com/grpc/grpc/blob/master/doc/statuscodes.md) (Transient Network Error). See [#41](https://github.com/creditsenseau/zeebe-client-node-js/issues/40).
Copy file name to clipboardExpand all lines: README.md
+48-10Lines changed: 48 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,8 @@ Docker-compose configurations for Zeebe are available at [https://github.com/zee
13
13
14
14
To enable that the client libraries can be easily supported to the Zeebe server we are remapping the version numbers, so that Major, Minor match the server application. Patches will be independent and indicate client updates.
Protobuf fields of type `int64` are serialised as type string in the Node library. These fields are serialised as numbers (long) in the Go and Java client. See [grpc/#7229](https://github.com/grpc/grpc/issues/7229) for why the Node library serialises them as string. The Workflow instance key, and other fields that are of type long in other client libraries, are type string in this library. Fields of type `int32` are serialised as type number in the Node library.
27
29
30
+
## Scaffolding code from a BPM file
31
+
32
+
You can scaffold your worker code from a BPMN file with the `bin/zeebe-node-cli` command. Pass in the path to the BPMN file, and it will produce a file to implement it.
33
+
28
34
## Example Use
29
35
30
36
### Add the Library to your Project
@@ -85,14 +91,23 @@ const zbc = new ZB.ZBClient(gatewayAddress, {
85
91
86
92
Retry is provided by [promise-retry](https://www.npmjs.com/package/promise-retry), and the back-off strategy is simple ^2.
87
93
88
-
### TLS
94
+
Additionally, the gRPC Client will contiually reconnect when in a failed state.
95
+
96
+
### OAuth
89
97
90
-
In case you need to connect to a secured endpoint, you can enable TLS.
98
+
In case you need to connect to a secured endpoint with OAuth (such as Camunda Cloud), you can pass in OAuth credentials. This will enable TLS, and handle the OAuth flow to get / renew a JWT:
@@ -180,6 +195,22 @@ Call `complete.failure()` to fail the task. You must pass in a string message de
180
195
complete.failure('This is a critical failure and will raise an incident', 0)
181
196
```
182
197
198
+
### Long polling
199
+
200
+
With Zeebe 0.21 onward, long polling is supported for clients. Rather than polling continuously for work and getting nothing back, a client can poll once and leave the request open until work appears. This reduces network traffic and CPU utilization in the server. Every JobActivation Request is appended to the event log, so continuous polling can significantly impact broker performance, especially when an exporter is loaded (see [here](https://github.com/creditsenseau/zeebe-client-node-js/issues/64#issuecomment-520233275)).
201
+
202
+
To use long pollling, pass in a long poll timeout in milliseconds to the client. All workers created with that client will use it.
203
+
204
+
Long polling for workers is enabled in the ZBClient, like this:
@@ -262,18 +293,13 @@ This will produce output similar to:
262
293
// Autogenerated constants for msg-start.bpmn
263
294
264
295
exportenumTaskType= {
265
-
266
296
CONSOLE_LOG="console-log"
267
-
268
297
};
269
298
270
299
exportenumMessageName= {
271
-
272
300
MSG_EMIT_FRAME="MSG-EMIT_FRAME",
273
301
MSG_START_JOB="MSG-START_JOB"
274
-
275
302
};
276
-
277
303
```
278
304
279
305
## Logging
@@ -344,10 +370,22 @@ npm run test:integration
344
370
345
371
For the failure test, you need to run Operate ([docker-compose config](https://github.com/zeebe-io/zeebe-docker-compose/blob/master/operate/docker-compose.yml)) and manually verify that an incident has been raised at [http://localhost:8080](http://localhost:8080).
346
372
373
+
### Writing Tests
374
+
375
+
Zeebe is inherently stateful, so integration tests need to be carefully isolated so that workers from one test do not service tasks in another test. Jest runs tests in a random order, so intermittent failures are the outcome of tests that mutate shared state.
376
+
377
+
For each feature:
378
+
379
+
- Use a unique bpmn process, named the same as the test file. Don't reuse processes between tests, because they are tightly coupled.
380
+
- Name the task types with a namespace that matches the test name. This avoids workers from one test servicing tasks from another test, which causes unpredictable behaviour.
381
+
- Cancel any workflows that do not run to completion in an `AfterAll` or `AfterEach` block. This avoids subsequent test runs interacting with workflows from a previous test run.
382
+
- Ensure that there no Active workflows in the engine after running the integration tests have run. This manual check is to verify that there is no left-over state. (Note one exception: the Raise Incident test leaves the workflow open for manual verification in Operate).
0 commit comments