Giter VIP home page Giter VIP logo

zeebe-client-csharp's People

Contributors

aanodin avatar askalik avatar berndruecker avatar bobcat1506 avatar brandon-mork avatar bulldetektor avatar celanthe avatar christian-oleson avatar dependabot-preview[bot] avatar dependabot[bot] avatar dimasm61 avatar falko avatar hofmeisteran avatar johnmichaelr avatar lennartkleymann avatar mrrickwi avatar renovate[bot] avatar shawnabshire avatar sindremb avatar terjeinnerdal avatar thompson-tomo avatar torstenzuther avatar xlegalles avatar xomiamoore avatar xphilipp avatar zelldon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zeebe-client-csharp's Issues

I can use the client to request the Custom Headers on Job Activation

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);
}

I have the possibility on creating an job worker to enable auto completion

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();

Migrate to Zeebe version 0.16.1

  • rename payload to variables
    • updatePayload -> setVariables
    • payload on create instance -> variables
    • payload on complete job -> variables
    • payload on publish message -> variables
  • add local flag to setVariables command

I can create an JobWorker for any job type

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.

Library should target .NET Standard 2.1 and eliminate Newtonsoft dependency

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.

Support async JobHandlers

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.

I have the possibility on creating an job worker to enable auto failing

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();

PublishMessageResponse Empty

The PublishMessageResponse class contains no properties to determine whether the response was success or failure.

To Reproduce
Steps to reproduce the behavior:

  1. Publish a new message using the NewPublishMessageCommand()
  2. Await the result
  3. Retrieve the PublishMessageResponse object
  4. This object has no properties.

Expected behavior

  1. The Publish Message Response object should have enough information in it to determine success or failure and a reason for failure.

Thanks
James

singleton client causes operation to fail

Describe the bug
I use the netcore framework to build microservices and inject ZeebeClient into StartUp.
image

Then, I call the process in the Service layer
image
image

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):

  • OS: aliyun k8s

Rename repository

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.

Stop logging when no active job requested

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 ?

Setup a test project and structure

  • setup .net test project with NUNIT
  • Use GRPC testing framework to test if the right requests are send to the broker
  • integration tests can be added later

ZeebeClient with aspnet core project

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

I can use the client to get workflow state/outcome

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.

Support ErrorHandler on JobWorkers

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.

Allow clients to create a workflow instance based on the Workflow Id

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();

Reiterate over JobWorker implementation

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.

Implement Topology request

AT:

  • there exist a method on the ZeebeClient to request the topology
  • there exist interfaces to wrap the grpc topology responses (see java client)
  • there exist tests to test the request and response mechanics

Grpc.Core Exception - Unhanded exception failed to connect to all addresses

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:

  1. Start zeebe client
    docker run -p 26500:26500 camunda/zeebe:latest

  2. Git checkout C Sharp client.

  3. Cd Client.Examples

  4. Run C Sharp Sample project as:
    dotnet run --project Client.Examples.csproj

  5. Error
    image

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):

  • OS: Windows 10

Add generated gRPC classes to project

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.

Create an README for this repo

README should contain following information's:

  • what is the project for
  • requirements
  • get started (nuget package)
  • example project ?
  • how to build
  • how to contribute ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.