GithubHelp home page GithubHelp logo

rust-camunda-client's People

Contributors

dansvidania avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

pieterhering

rust-camunda-client's Issues

reqwest crate's default "time out" definition should be removed

Hi @Dansvidania , here is an improvement for the library. As we discussed in Dansvidania/camunda-worker#11 Camunda REST API allows long polling. For the duration you set while you perform "fetch and lock" for an external task, you can set a timer up to 30 minutes and for that long the HTTP connection is kept alive and Camunda pushes the client newly created tasks immediately thereby eliminating the constant need for making new HTTP requests to check if there is a new task.

However, reqwest crate which is used here comes with a default time out period of 30 seconds. This breaks the long polling set longer than 30 seconds. There is a configuration function to disable it.

https://docs.rs/reqwest/0.8.4/reqwest/struct.ClientBuilder.html

fn timeout<T>(&mut self, timeout: T) -> &mut ClientBuilder 
where
    T: Into<Option<Duration>>, 
[src][โˆ’]
Set a timeout for connect, read and write operations of a Client.

Default is 30 seconds.

Pass None to disable timeout.

Propogation of Errors from the Reqwest Crate

Hi @Dansvidania , the current implementation converts Errors from the Reqwest crate into the library's own Error implementation. However, this conversion loses some part of the error messages. This is done in here: https://github.com/Dansvidania/rust-camunda-client/blob/master/src/apis/mod.rs

An example:

This is what is propogated to where the lib is used in the camunda_worker:

Reqwest(Error(Status(500), "http://localhost:8080/engine-rest/external-task/8d762d22-a7ea-11eb-a622-0242ac110002/complete"))

An this is the actual response when we make the same request from Postman:

{
    "type": "ProcessEngineException",
    "message": "ENGINE-02025 Variable 'xxxListVar' is not of the expected type 'Collection'."
}

Should we create a proper impl Fromreqwest::Error for Error implemantation or what? Any ideas?

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.