camunda-community-hub / zeebe-client-csharp Goto Github PK
View Code? Open in Web Editor NEWContains an Zeebe C# client implementation.
Home Page: https://camunda-community-hub.github.io/zeebe-client-csharp/
License: Apache License 2.0
Contains an Zeebe C# client implementation.
Home Page: https://camunda-community-hub.github.io/zeebe-client-csharp/
License: Apache License 2.0
As a user of the C# client, when Custom Headers are assigned to a Job, I would like the ability to capture these key-value pairs when a job is activated.
Describe the solution you'd like
The solution is to mimic implementation of similar Activated Job features. The implementation of CustomHeaders property shall closely resemble the implementation of the Variables property.
Additional context
The intent is to closely follow the same Custom Header implementation as found within the Java Client.
https://github.com/zeebe-io/zeebe/blob/master/clients/java/src/main/java/io/zeebe/client/impl/response/ActivatedJobImpl.java
Example
public ActivatedJob(GatewayProtocol.ActivatedJob activatedJob)
{
....
....
Variables = activatedJob.Variables;
VariablesAsDictionary = JsonConvert.DeserializeObject<Dictionary<string, object>>(Variables);
CustomHeaders = activatedJob.CustomHeaders;
CustomHeadersAsDictionary = JsonConvert.DeserializeObject<Dictionary<string, object>>(CustomHeaders);
}
Describe the solution you'd like
Provide a graceful way of stopping IJobWorker instances such as a StopAsync() method.
Is your feature request related to a problem? Please describe.
We have always to complete the job by our own. The worker should be able to complete the job automatically after the job handler returns. This should be enabled by an optional setting.
Describe the solution you'd like
An optional setting for example called autoComplete
Example:
zeebeClient.NewWorker()
.JobType("bar")
.Handler((client, job) =>
{
// business logic
})
.MaxJobsActive(5)
.Name("zb-worker")
.PollInterval(TimeSpan.FromSeconds(5))
.Timeout(10_000L)
.autoComplete()
.Open();
Describe the bug
CamundaCloudTokenProvider holds a reference to an HttpClientHandler which is disposable but is never disposed
Expected behavior
Types owning disposable types should be disposable and should dispose instances of disposables.
Additional context
https://docs.microsoft.com/en-us/visualstudio/code-quality/ca2213?view=vs-2019
Describe the bug
JobWorker.FailActivatedJob does not await NewFailCommand
see related camunda/camunda#3487
Is your feature request related to a problem? Please describe.
It would be useful to read to doc in more humand readable form on a page.
Take a look at https://github.com/dotnet/docfx
Related https://forum.zeebe.io/t/c-zeebe-client-methods/758/6
Implement the functionality to create an job worker which polls repeatedly jobs of an given type.The job worker accepts an handler implementation which is executed if an job was activated.
Describe the bug
Your library should depend on Microsoft.Extensions.Logging.Abstractions not NLog.
To Reproduce
Expected behavior
Your library should depend on Microsoft.Extensions.Logging.Abstractions not NLog. https://www.nuget.org/packages/Microsoft.Extensions.Logging.Abstractions/
Additional context
Systems should be free to choose their own logging implementation.
AT:
Describe the bug
Library should target .NET Standard 2.1 and eliminate Newtonsoft dependency
Expected behavior
Library should target .NET Standard 2.1 and eliminate Newtonsoft dependency
Additional context
Microsoft is breaking the Newtonsoft dependency with .NET Standard 2.1 and so should libraries.
AT:
Your nuget package reference the https://github.com/zeebe-io/zeebe-csharp-client instead of https://github.com/zeebe-io/zeebe-client-csharp
Last two words inverted.
Add a logging to the client so it is easier to debug and trace errors and also get more insights what actually happens. Take a look into log4net and NLog and choose one, there are some references to read:
https://nlog-project.org/
https://www.loggly.com/blog/benchmarking-5-popular-net-logging-libraries/
https://logging.apache.org/log4net/
https://raygun.com/blog/c-sharp-logging-best-practices/
Is your feature request related to a problem? Please describe.
Asnyc job handlers are currently not supported, if we want to get the result of an async call we need to do this:
private async Task HandleJob(IJobClient jobClient, IJob job)
{
// business logic
var jobKey = job.Key;
Console.WriteLine("Handling job: " + job);
jobClient.NewCompleteJobCommand(jobKey)
.Variables("{\"foo\":2}")
.GetAwaiter()
.GetResult();
Console.WriteLine("Job with key " + jobKey + " completed.");
}
Describe the solution you'd like
I would like to have job handlers like this:
private async Task HandleJob(IJobClient jobClient, IJob job)
{
// business logic
var jobKey = job.Key;
Console.WriteLine("Handling job: " + job);
var completeJobResponse = await jobClient.NewCompleteJobCommand(jobKey)
.Variables("{\"foo\":2}")
.Send();
Console.WriteLine("Job with key " + jobKey + " completed.");
}
Describe alternatives you've considered
As described above only with .GetAwaiter
possible.
Additional context
We need to overload the JobHandler
to allow both.
Is your feature request related to a problem? Please describe.
If an exception in the job handler code happens, them the job worker should automatically fail the corresponding job.
Describe the solution you'd like
An optional setting for example called jobfailOnException
Example:
zeebeClient.NewWorker()
.JobType("bar")
.Handler((client, job) =>
{
// business logic
})
.MaxJobsActive(5)
.Name("zb-worker")
.PollInterval(TimeSpan.FromSeconds(5))
.Timeout(10_000L)
.jobfailOnException()
.Open();
Describe the bug
JobWorker.HandleActivatedJobs does not await NewCompleteJobCommand
Simply make it possible to activate jobs directly via API, without using an worker.
The PublishMessageResponse class contains no properties to determine whether the response was success or failure.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Thanks
James
Describe the bug
I use the netcore framework to build microservices and inject ZeebeClient into StartUp.
Then, I call the process in the Service layer
When I deploy on k8s, the previous calls return the correct result, but after a period of time (about 30min), it will cause a timeout.
Expected behavior
I hope that the singleton client always guarantees success when called
Enviroment (please complete the following information):
What do you think about renaming the repository to zeebe-client-csharp
then we could have the naming scheme zeebe-client-LANGUAGE
for all the clients.
When no jobs are pending we trace :
fail: Zeebe.Client.Impl.Worker.JobWorker[0] Unexpected RpcException on polling new jobs. Grpc.Core.RpcException: Status(StatusCode=DeadlineExceeded, Detail="Deadline Exceeded")
Can becomes difficult to read log file after a while. Can be worth it to not log this ?
Using references on Microsoft DependencyInjection version 3.1.0 prevents me from using the zeebe-client with an aspnet core 2.1 project.
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.1.0" />
Normally keeping a reference on 2.1.1 version allow us to use it in aspnet core 2.1 and 3.1
Is your feature request related to a problem? Please describe.
A often requested feature is to request the outcome of an workflow.
In the near feature I'm not sure if we want to implement this in the broker, but what we can easily do is to use the hazelcast exporter. The user needs to register the exporter in the broker and the client can connect to the exporter.
In that way the user can request/search for the outcome of an specific workflow instance.
Describe the solution you'd like
Either an new API to find/wait for some specific events
OR just a method on the Workflow object to get the result.
WorkflowInstance instance = client.Find().WorkflowInstance().WithKey(key);
WorkflowInstance instance = await client.NewCreateWorkflowInstanceCommand()....Send();
WorkflowInstanceResult result = await instance.Result;
It might be better to have the first approach, since then we can check the current state of the workflow instance to see if there is an incident for example or just get the variables.
Describe alternatives you've considered
There are none.
Is your feature request related to a problem? Please describe.
Use build in tls from grpc see related issues https://github.com/zeebe-io/zeebe/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+tls
Is your feature request related to a problem? Please describe.
With the auto completion feature and the auto fail on a handling exception the user do not need to write this logic by himself, but it would be ideal to have an callback if the auto completion or handling fails.
With on an error callback the user could do rollbacks for work which was done during the handling.
Describe the solution you'd like
Add a new handler which is called on error.
Describe alternatives you've considered
We could also add a new interface for the job handling, which contains an onError method, but this would break the API.
Describe the solution you'd like
Workflow's are typically deployed at the same time as application code and deployments must be scripted ahead of time. If the workflow key is generated at deployment time there may be no way to update applications with that key. If applications could create a workflow instance based on the workflow id that would alleviate this issue. This is the id I'm referring to:
<bpmn:process id="demoProcess" isExecutable="true">
And code like this:
await client
.NewCreateWorkflowInstanceCommand()
.WorkflowKey("demoProcess")
.Variables(WorkflowInstanceVariables)
.Send();
related camunda/camunda#2931
Currently the job worker runs two threads (one for polling one for handling). The polling happens after the poll interval is due, but the worker should check if the job activation limit is already reached. Furthermore it should not merely use the given job limit to activate the next jobs, but rather calculate how many jobs should be activated such that the limit is not exceeded.
The timeout is not set correctly in this case and the gateway will complain that the timeout can't be zero,
AT:
Describe the bug
public async Task<Empty> Send()
{
gatewayClient.PublishMessage(request);
return null;
}
Expected behavior
Asynchronous and returns a response object.
Describe the bug
I used the net Fx4.7.1+ project to reference the zb-client 0.11.0 version and waited after executing the command.
Is your feature request related to a problem? Please describe.
I'm always frustrated when I have to write backpressure and network failure handling manually.
Describe the solution you'd like
Configurable retries with something like https://github.com/App-vNext/Polly baked in.
Grpc Exception - Unhanded exception failed to connect to all addresses
As stated in the documentation, I started in Sample run steps, I started the zeebe client first which seems running with default setting and then Client.Examples cs project which resulting into gRPC exception
To Reproduce
Steps to reproduce the behavior:
Start zeebe client
docker run -p 26500:26500 camunda/zeebe:latest
Git checkout C Sharp client.
Cd Client.Examples
Run C Sharp Sample project as:
dotnet run --project Client.Examples.csproj
I assume Zeebe client in step # 1 is the only prerequisite as stated for this sample run...
Am I missing anything?
Expected behavior
As I understand, client uses Zeebe orchestration client, deploy the workflow file and complete the flow as per workflow.
Enviroment (please complete the following information):
Currently the generated gRPC c# classes are not added to the repository.
This makes it hard to simply clone and build the project.
I think it makes sense to add them to the repository to get a better starting experience.
On new zeebe releases it makes sense to re-generate the classes, but in the mean time they will not change either.
README should contain following information's:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.