The Zeebe C# client is a C# wrapper implementation around the GRPC (https://github.com/grpc/grpc) generated Zeebe client. It makes it possible to communicate with Zeebe Broker via the GRPC protocol, see the Zeebe documentation for more information about the Zeebe project.
- .net standard 2.0 or higher, which means
- .net core 2.1 or higher or
- .net framework 4.7.1 or higher
- latest zeebe release (0.14.0)
The Zeebe C# client is available via nuget (https://www.nuget.org/packages/zb-client/).
Simply run msbuild Zeebe.sln
or dotnet build Zeebe.sln
- Request topology
- JobWorker
- Complete Job
- Fail Job
- Publish Message
- Deploy an resource
- Create a workflow instance
- Update an element instance payload
- Update retries of an job
- Resolve an existing incident
- Cancel an existing workflow instance
- List all workflows
- Request a workflow resource
To create a client use this:
var zeebeClient = ZeebeClient.NewZeebeClient("localhost:26500");
ITopology top = await zeebeClient.TopologyRequest().Send();
zeebeClient.NewWorker()
.JobType("bar")
.Handler((client, job) =>
{
// business logic
})
.Limit(5)
.Name("zb-worker")
.PollInterval(TimeSpan.FromSeconds(5))
.Timeout(10_000L)
.Open();
client.NewCompleteJobCommand(JobKey).Payload("{\"foo\":23}").Send();
client.NewFailCommand(job.Key).Retries(job.Retries - 1).ErrorMessage("This job failed.").Send();
var deployResponse = await client.NewDeployCommand().AddResourceFile(DemoProcessPath).Send();
var workflowKey = deployResponse.Workflows[0].WorkflowKey;
var workflowInstanceResponse = await client
.NewCreateWorkflowInstanceCommand()
.WorkflowKey(workflowKey)
.Payload("{\"foo\":\"123\"}")
.Send();
await client.NewUpdatePayloadCommand(workflowInstanceResponse.WorkflowInstanceKey)
.Payload("{\"a\":\"newPayload\"}")
.Send();
await client.NewUpdateRetriesCommand(45).Retries(2).Send();
await client.NewResolveIncidentCommand(17).Send();
await client.NewCancelInstanceCommand(workflowInstanceResponse.WorkflowInstanceKey).Send();
var workflowListResponse = await client.NewListWorkflowRequest().Send();
var workflowResourceResponse = await client.NewWorkflowResourceRequest().BpmnProcessId("ship-parcel").LatestVersion().Send();