英文:
Cannot create process instance after moving to camunda-cloud lib
问题
我开发了一个与Zeebe交互的小程序。我使用的是Go语言版本1.16和这个库github.com/zeebe-io/zeebe/clients/go来访问broker。
我引导了Zeebe客户端,然后使用以下代码创建了一个已部署建模流程的流程实例:
BrokerAddr := os.Getenv("ZEEBE_BROKER_ADDRESS")
zbClient, err := zbc.NewClient(&zbc.ClientConfig{
GatewayAddress: BrokerAddr,
UsePlaintextConnection: true,
KeepAlive: 1 * time.Second,
})
if err != nil {
panic(err)
}
request, err := zbClient.NewCreateInstanceCommand().BPMNProcessId(triggerDataConfig.ProcessID).LatestVersion().VariablesFromObject(variables)
if err != nil {
panic(err)
} else {
result, err := request.Send(context.Background())
}
然后,我切换到了新的客户端库1.0.1,也迁移到了另一个仓库github.com/camunda-cloud/zeebe/clients/go,现在当我尝试发送请求**zeebeRequest.Send(context.Background())**时,出现了以下错误:
rpc error: code = Unimplemented desc = Method not found: gateway_protocol.Gateway/CreateProcessInstance
更新
由于被投票下降,我稍微详细解释一下问题,正确的答案如下。同时也将broker更新到1.0.1版本。
英文:
I develop small program to interact with Zeebe. I use golang version 1.16 and this library github.com/zeebe-io/zeebe/clients/go to access the brooker.
I bootstrap the Zeebe client and then I create a process instance of a deployed modeled process with this code:
BrokerAddr := os.Getenv("ZEEBE_BROKER_ADDRESS")
zbClient, err := zbc.NewClient(&zbc.ClientConfig{
GatewayAddress: BrokerAddr,
UsePlaintextConnection: true,
KeepAlive: 1 * time.Second,
})
if err != nil {
panic(err)
}
request, err :=zbClient.NewCreateInstanceCommand().BPMNProcessId(triggerDataConfig.ProcessID).LatestVersion().VariablesFromObject(variables)
if err != nil {
panic(err)
}else
{
result, err := zeebeRequest.Send(context.Background())
}
Then I switched to the new one client library 1.0.1, also moved to another repo github.com/camunda-cloud/zeebe/clients/go and now I got this error when I try to send the request zeebeRequest.Send(context.Background())
rpc error: code = Unimplemented desc = Method not found: gateway_protocol.Gateway/CreateProcessInstance
UPDATE
I elaborate a bit the question due to downvote, the correct answer is below. Just update the broker as well to 1.0.1 version
答案1
得分: 3
如果您更新了客户端,还需要更新代理。看起来您仍在使用旧版本的代理。
您现在使用的Go客户端(已移至camunda-cloud组织)版本为1.0,仅与代理版本1.0+兼容。
grpc的gateway_protocol.Gateway/CreateProcessInstance
仅存在于1.0+版本中,之前称为CreateWorkflowInstance
。代码库中的workflow术语已被process取代。
您可以在发布公告中了解更多信息:https://camunda.com/blog/2021/05/camunda-cloud-10-released/
英文:
If you update your client, you also need to update the broker. It seems you're still using an older version of the broker.
The go client (which has been moved to the camunda-cloud org) you're using now is on version 1.0 and is only compatible with broker version 1.0+.
The grpc gateway_protocol.Gateway/CreateProcessInstance
only exist in 1.0+, previously it was called CreateWorkflowInstance
. The usage of the workflow term has been replaced by process, everywhere in the code base.
You can read more about that in the release announcement https://camunda.com/blog/2021/05/camunda-cloud-10-released/
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论