citilinkru / camunda-client-go Goto Github PK
View Code? Open in Web Editor NEWCamunda REST API client for golang
License: MIT License
Camunda REST API client for golang
License: MIT License
camunda-client-go/processor/processor.go
Line 10 in ab5c5c8
This import not is v1 version
The Send Message doesn't have correlation keys.
bpmnClient.QueryFetchAndLockTopic.ProcessDefinitionKeyIn
Sorry my pure english
We have error when start handling external tasks, I thing this need slice not pointer string
http://camunda-process/engine-rest/external-task/fetchAndLock: net/http: request canceled (Client.Timeout exceeded while awaiting headers), sleeping: 26 seconds","time":"2019-12-20T06:59:49Z","title":"camunda-client"}
Как это решить?
When I call the Modify method of ProcessInstance, a parameter of type ReqModifyProcessInstance is required, which contains an slice of type ReqModifyProcessInstanceInstruction struct, and its "Variables" property should be an object of type map[string]ReqProcessVariable, not a slice of type ReqProcessVariable.
The official documentation description is: A JSON object containing variable key-value pairs. Each key is a variable name and each value a JSON variable value object.
type ReqModifyProcessInstanceInstruction struct {
// ...
// A JSON object containing variable key-value pairs.
// Each key is a variable name and each value a JSON variable value object.
Variables []ReqProcessVariable `json:"variables"`
}
I am wondering if v2 is a recommended version or is it experimental? Against which version should someone submit a new PR?
At the time I am writing this, the most recent commit in master (5b9b9ff) removed all reference to v2. This is confusing to know that there is a v2 out there but there is no mention of it in the README when landing on the main github page of the project.
Thank you.
When calling QueryFetchAndLock (POST /external-task/fetchAndLock
) with the QueryFetchAndLockTopic.ProcessVariables set, the camuda api returns the err Object values cannot be used to query
. It seems that the ProcessVariables for the QueryFetchAndLockTopic should be a map[string]interface{}, where the value should be a string, number, or other camunda supported primitive, instead of map[string]Variable. (For Reference: Camunda Fetch & Lock External Task API Doc).
Current request payload:
{
"workerId": "worker-x",
"maxTasks": 1,
"topics": [
{
"topicName": "topic-y",
"lockDuration": 100,
"businessKey": "8e539d03-...",
"processVariables": {
"resourceVersion": {
"type": "String",
"value": "44",
"valueInfo": {}
}
}
}
]
}
Suggested request payload:
{
"workerId": "worker-x",
"maxTasks": 1,
"topics": [
{
"topicName": "topic-y",
"lockDuration": 100,
"businessKey": "8e539d03-...",
"processVariables": {
"resourceVersion": "44"
}
}
]
}
See: https://docs.camunda.org/manual/7.11/reference/rest/process-definition/post-start-process-instance/.
This impacts the ReqStartInstance
and ReqRestartInstance
types.
There is a problem with the type of "QueryFetchAndLockTopic.TenantIdIn". I get an error with type *string but It works If I change it to *[]string.
Current: QueryFetchAndLockTopic.TenantIdIn *string json:"tenantIdIn,omitempty"
TenantIdIn := "test"
proc.AddHandler(
&[]camundaclientgo.QueryFetchAndLockTopic{
{TopicName: "testTopic", TenantIdIn: &TenantIdIn},
},
error:
{"level":"debug","error":"failed pull: request error: response error with status code 400: Cannot construct instance of java.lang.String[]: no String-argument constructor/factory method to deserialize from String value ('test')\n
at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 193] (through reference chain: org.camunda.bpm.engine.rest.dto.externaltask.FetchExternalTasksExtendedDto["topic
s"]->java.util.ArrayList[1]->org.camunda.bpm.engine.rest.dto.externaltask.FetchExternalTasksDto$FetchExternalTaskTopicDto["tenantIdIn"]), sleeping: 2 seconds","time":"2021-11-17T12:02:25Z","message":"Camunda"}
Suggested: QueryFetchAndLockTopic.TenantIdIn *[]string json:"tenantIdIn,omitempty"
proc.AddHandler(
&[]camundaclientgo.QueryFetchAndLockTopic{
{TopicName: "testTopic", TenantIdIn: &[]string{"test"}},
},
func (p *Processor) startPuller(query camundaclientgo.QueryFetchAndLock, handler Handler) {
var tasksChan = make(chan *camundaclientgo.ResLockedExternalTask)
maxParallelTaskPerHandler := p.options.MaxParallelTaskPerHandler
if maxParallelTaskPerHandler < 1 {
maxParallelTaskPerHandler = 1
}
// create worker pool
for i := 0; i < maxParallelTaskPerHandler; i++ {
p.workerGroup.Add(1)
go p.runWorker(handler, tasksChan)
}
go func() {
retries := 0
for {
select {
case <-p.ctx.Done():
close(tasksChan)
return
default:
tasks, err := p.client.ExternalTask.FetchAndLock(query)
if err != nil {
if retries < 60 {
retries += 1
}
p.logger(fmt.Errorf("failed pull: %w, sleeping: %d seconds", err, retries))
time.Sleep(time.Duration(retries) * time.Second)
continue
}
retries = 0
for _, task := range tasks {
tasksChan <- task
}
}
}
}()
}
В рутине в бесконечном цикле нет возможности проставить паузу между запросами. С увеличением кол-ва экстернал тасков - увеличивается сетевой трафик и забивается пул конекций
Camunda throws an org.camunda.bpm.engine.MismatchingMessageCorrelationException
exception when businessKey
field in POST /message
is an empty string.
BusinessKey
field in ReqMessage
struct in message.go
should have omitempty
for it work properly.
Hi,I am a software developer currently working with your Go client for the Camunda BPM platform, and I must commend you for your excellent work.
However, as I continue to integrate the Go client into my projects, I noticed that the current version lacks Prometheus metrics in the client. Utilizing Prometheus metrics has been an essential part of my workflow, enabling effective monitoring and performance tracking.
I am aware that Camunda provides its own API for metrics, but for my specific use-case, I require these metrics on the client-side.
I understand that adding this feature might require substantial efforts and architectural considerations. But I believe that including Prometheus metrics would significantly improve the utility of the client and benefit other developers who also rely on comprehensive monitoring tools.
Given this, I would like to propose contributing to your project by adding Prometheus metrics on the client-side. I would appreciate your feedback and guidance on this.
Could you kindly inform me if there are plans to integrate Prometheus metrics into the client in the foreseeable future, or if my contribution in this regard would be welcome?
There is currently no way to programmatically stop long polling on a Processor. Once started, long polling stops only when the process exits. This makes it very hard to have multiple separate integration tests on a single package without interference.
I’ve prepared a PR, #39, that add the ability to stop long polling
Does this library implement external service task support external service task retrieval?
How to implement it ?
THX
Hello. I had a need to run events, with the transfer of local variables, so that they were not visible on the main process.
There is such an opportunity in the documentation, I checked it with a postman, everything also works. I wanted to expand api through PR, but no returns 403 ((
link to documentation: https://docs.camunda.org/manual/7.11/reference/rest/message/post-message/
Use rest deploy bpmn file not start with client.ProcessDefinition.StartInstance
, only be used in user interface. My username and password are correct . Why?
Since the lib is using int type for the 'retries' field it is not possible to understand the difference between 'null' and '0'
I've created a PR to solve that:
#34
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.