Reputation: 927
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
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
Upvotes: 0
Views: 1349
Reputation: 9933
This is how I resolved the same error that I was encountering.
I was facing the same issue, but the problem was the docker container, then I built my container for Zeebe from its official link https://docs.camunda.io/docs/self-managed/platform-deployment/docker/
using command:
docker run --name zeebe -p 26500-26502:26500-26502 camunda/zeebe:latest
Then I use the following code to deploy and evaluate the 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));
})();
Upvotes: 1
Reputation: 5516
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/
Upvotes: 4