pay-k / nestjs-zeebe

Zeebe transport and client for nestjs framework
MIT License
42 stars 19 forks source link

Access to the ZBClient instance #16

Open jwulf opened 4 years ago

jwulf commented 4 years ago

I've written a new monitoring package for Zeebe clients and workers: https://github.com/jwulf/zeebe-canaryize.

It relies on an upcoming patch that makes the ZBClient and the ZBWorker event emitters that emit ready and connectionError events.

To use it, you need to pass in the ZBClient / ZBWorker instance to the canaryize function.

What's the best way to integrate this functionality with this package?

jwulf commented 4 years ago

For the client, I can do this:

export class WorkflowController {
  constructor(
    @Inject(ZEEBE_CONNECTION_PROVIDER) private readonly zbClient: ZBClient,
    @Inject(WINSTON_MODULE_PROVIDER) private readonly logger: Logger,
  ) {
    canaryize(zbClient, {
      url: ChirpUrl,
      minutes: 5,
    })
  }

What about for the worker?

danshapir commented 4 years ago

The workers are created behind the scenes in the zeebe-server.ts so only there will you gain access to it.