All Projects → pay-k → nestjs-zeebe

pay-k / nestjs-zeebe

Licence: MIT license
Zeebe transport and client for nestjs framework

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to nestjs-zeebe

stack
🥭 nxpm-stack lets you generate a complete and opinionated full-stack application in a Nx Workspace, ready to extend and deploy!
Stars: ✭ 98 (+145%)
Mutual labels:  nestjs
nest-angular-auth-client
Angular client for NestJS authentication (Login, Register, Google Login, Facebook Login, Apple Login, Messages, Rooms, Private DMs)
Stars: ✭ 16 (-60%)
Mutual labels:  nestjs
nest-admin
采用nestjs typeorm vue开发的一套权限管理系统
Stars: ✭ 256 (+540%)
Mutual labels:  nestjs
nest-abstract
NestJs Abstraction Helper
Stars: ✭ 36 (-10%)
Mutual labels:  nestjs
angular-nest-grpc
Example full-stack Typescript project using Angular, NestJS and gRPC
Stars: ✭ 85 (+112.5%)
Mutual labels:  nestjs
nest-admin
NestJs CRUD for RESTful API使用 nestjs + mysql + typeorm + redis + jwt + swagger 企业中后台管理系统项目RBAC权限管理(细粒度到按钮)、实现单点登录等。
Stars: ✭ 165 (+312.5%)
Mutual labels:  nestjs
zeebe-kafka-exporter
Export events from Zeebe to Kafka
Stars: ✭ 21 (-47.5%)
Mutual labels:  zeebe
next
不再维护,请直接查看 https://github.com/notadd/notadd
Stars: ✭ 15 (-62.5%)
Mutual labels:  nestjs
gondor
Nestjs Framework, Prisma database layer w/ Angular and Apollo.
Stars: ✭ 14 (-65%)
Mutual labels:  nestjs
prisma-nestjs-graphql
Generate object types, inputs, args, etc. from prisma schema file for usage with @nestjs/graphql module
Stars: ✭ 276 (+590%)
Mutual labels:  nestjs
reactnest-boilerplate
🗼A starter project template with (Ngnix, ReactJS, Redux, Redux Thunk, React Router, NestJS, TypeORM, PostgreSQL, Docker, PM2) + (Code Style, Conventional Changelog with Commitlint, Husky, Git CZ)
Stars: ✭ 85 (+112.5%)
Mutual labels:  nestjs
connect4
Connect 4️⃣Game
Stars: ✭ 1 (-97.5%)
Mutual labels:  nestjs
nest-auth-example
Nest.js authentication with Passport. Realworld example
Stars: ✭ 186 (+365%)
Mutual labels:  nestjs
uniauth-backend
backend service to power uniAuth
Stars: ✭ 16 (-60%)
Mutual labels:  nestjs
react-ssr-advanced-seed
🔮 React SSR Advanced Seed (Typescript + nestJS + React SSR + React Native + Docker)
Stars: ✭ 76 (+90%)
Mutual labels:  nestjs
is-even
SaaS platform for checking if number is even
Stars: ✭ 66 (+65%)
Mutual labels:  nestjs
fullstack-ts-boilerplate
Full-stack boilerplate in TS using modern technology
Stars: ✭ 25 (-37.5%)
Mutual labels:  nestjs
ionic-ecommerce
eCommerce client for IOS, Android and Windows Platform with Ionic
Stars: ✭ 66 (+65%)
Mutual labels:  nestjs
spring-zeebe
Easily use the Zeebe Java Client in your Spring or Spring Boot projects
Stars: ✭ 103 (+157.5%)
Mutual labels:  zeebe
nestjs-graphql-gateway
Apollo Federation support for NextJS GraphQL module. Note: There is support for federation in the official package now so this project is deprecated
Stars: ✭ 13 (-67.5%)
Mutual labels:  nestjs

Nest Logo

NestJS Zeebe Connector (Transport and Client)

A zeebe transport and client for NestJS

Using the zeebe-node module and exposing it as a NestJS transport and module.

Build Status

Install

npm install @payk/nestjs-zeebe

Basic usage

    // app.module.ts
    import { Module } from '@nestjs/common';
    import { AppController } from './app.controller';
    import { ZeebeModule, ZeebeServer } from '@payk/nestjs-zeebe';

    @Module({
    imports: [ ZeebeModule.forRoot({ gatewayAddress: 'localhost:26500' })],
    controllers: [AppController],
    providers: [ZeebeServer],
    })
    export class AppModule {}
    // main.ts
    import { NestFactory } from '@nestjs/core';
    import { AppModule } from './app.module';
    import { ZeebeServer } from '@payk/nestjs-zeebe';

    async function bootstrap() {
    const app = await NestFactory.create(AppModule);
    const microservice = app.connectMicroservice({
        strategy: app.get(ZeebeServer),
    });

    await app.startAllMicroservicesAsync();

    await app.listen(3000);
    }
    bootstrap();
    // app.controller.ts
    import { Controller, Get, Inject } from '@nestjs/common';
    import { AppService } from './app.service';
    import { ZBClient } from 'zeebe-node';
    import { CreateWorkflowInstanceResponse, CompleteFn, Job } from 'zeebe-node/interfaces';
    import { ZEEBE_CONNECTION_PROVIDER, ZeebeWorker } from '@payk/nestjs-zeebe';
    import {
        Ctx,
        Payload,
    } from '@nestjs/microservices';

    @Controller()
    export class AppController {
        constructor(private readonly appService: AppService, @Inject(ZEEBE_CONNECTION_PROVIDER) private readonly zbClient: ZBClient) {}

        // Use the client to create a new workflow instance
        @Get()
        getHello() : Promise<CreateWorkflowInstanceResponse> {
            return this.zbClient.createWorkflowInstance('order-process', { test: 1, or: 'romano'});
        }

        // Subscribe to events of type 'payment-service
        @ZeebeWorker('payment-service')
        paymentService(@Payload() job, @Ctx() fn: CompleteFn<any> {
            console.log('Payment-service, Task variables', job.variables);
            let updatedVariables = Object.assign({}, job.variables, {
            paymentService: 'Did my job',
            });

            // Task worker business logic goes here

            complete.success(updatedVariables);
        }

        // Subscribe to events of type 'inventory-service and create a worker with the options as passed below (zeebe-node ZBWorkerOptions)
        @ZeebeWorker('inventory-service', { maxJobsToActivate: 10, timeout: 300 })
        inventoryService(@Payload() job, @Ctx() fn: CompleteFn<any>) {
            console.log('inventory-service, Task variables', job.variables);
            let updatedVariables = Object.assign({}, job.variables, {
            inventoryVar: 'Inventory donnnneee',
            });

            // Task worker business logic goes here

            complete.success(updatedVariables);
        }
    }
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].