Search code examples
gocamundazeebe

Cannot create process instance after moving to camunda-cloud lib


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


Solution

  • 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/