dansvidania / rust-camunda-client Goto Github PK
View Code? Open in Web Editor NEWcamunda client generated via openapi-generator
camunda client generated via openapi-generator
Thank you for this (auto-generated?) library, it's really useful and saved a lot of time to implement from scratch. The URI defined for the process definition API should be corrected as "process-definition". Currently it is typed as "process_definition". Please check https://docs.camunda.org/manual/latest/reference/rest/process-definition/post-start-process-instance/.
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.
Hi, @Dansvidania , I see that the Decision Definition forund at https://docs.camunda.org/manual/latest/reference/rest/decision-definition/ is not generated within the library. Is there a certain reason you know?
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?
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.