移动到 camunda-cloud lib 后无法创建流程实例

问题描述 投票:0回答:2

我开发了一个与Zeebe交互的小程序。我使用golang版本1.16和这个库github.com/zeebe-io/zeebe/clients/go来访问brooker。

我引导 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 := zeebeRequest.Send(context.Background())
    }

然后我切换到新的客户端库 1.0.1,还移动到另一个存储库 github.com/camunda-cloud/zeebe/clients/go 现在当我尝试发送请求 zeebeRequest 时收到此错误。发送(context.Background())

rpc error: code = Unimplemented desc = Method not found: gateway_protocol.Gateway/CreateProcessInstance

更新

我详细阐述了由于否决而产生的问题,正确答案如下。只需将经纪人也更新到1.0.1版本

go camunda zeebe
2个回答
4
投票

如果您更新了客户端,您还需要更新经纪商。您似乎仍在使用旧版本的代理。

您现在使用的 go 客户端(已移至 camunda-cloud 组织)是 1.0 版本,仅与代理版本 1.0+ 兼容。

grpc

gateway_protocol.Gateway/CreateProcessInstance
仅存在于1.0+,以前称为
CreateWorkflowInstance
。工作流术语的使用已被流程取代,在代码库中随处可见。

您可以在发布公告中阅读更多相关信息https://camunda.com/blog/2021/05/camunda-cloud-10-released/


0
投票

这就是我解决遇到的相同错误的方法。

我面临着同样的问题,但问题是docker容器,然后我从其官方链接为Zeebe构建了容器https://docs.camunda.io/docs/self-management/platform-deployment/docker/ 使用命令:

docker run --name zeebe -p 26500-26502:26500-26502 camunda/zeebe:latest

然后我使用以下代码来部署和评估 DMN。

const ZB = require('zeebe-node');

void (async () => {
  const zbc = new ZB.ZBClient('localhost:26500');
  const result = await zbc.deployResource({
    decisionFilename: 'test.dmn',
  });
  console.log('result:', JSON.stringify(result));

  const outcome = await zbc.evaluateDecision({
    decisionId: 'Decision_108bhbw',
    variables: {
      test: 'test',
    },
  });
  console.log('Process outcome', JSON.stringify(outcome));
})();

© www.soinside.com 2019 - 2024. All rights reserved.