I’m building a demo to pitch temporal to my company, this is from nodeJS, I created a grpc client and I’m able to receive tasks and process them, but when sending the reply I can’t figure out the correct encoding.
Worker complains
payload item 0: metadata is not set (type: wrapError, retryable: true): metadata is not set
And when I see the temporalUI the values look to be base64 encoded and not the json object I see when a go worker answers.
the UI shows:
ActivityTaskCompleted:
[
"e0Vycjp1bGlubGFlOnRz.."
]
this is what I have
return new Promise((resolve, reject) => {
const payload = new Payload()
const activityReturnString = JSON.stringify(activityReturn)
const s = Buffer.from(activityReturnString).toString()
var result = [];
for (var i = 0; i < s.length; i += 2) {
// result.push(parseInt(s.substring(i, i + 2), 16));
result.push(s.charCodeAt(i))
}
payload.setData(Uint8Array.from(result))
const payloads = new Payloads()
payloads.addPayloads(payload)
const request = new RespondActivityTaskCompletedRequest()
request.setResult(payloads)
request.setTaskToken(activityTaskToken)
request.setIdentity('IdentityString')
this.client.respondActivityTaskCompleted(request, (err) => {
if (err) {
reject(err)
return
}
resolve(true)
})
})
I have tried encoding in base64, adding a metadata / data, but can’t return data.
ps. i’m aware there’s a new node SDK but I have tried (with no luck) to make it work, and I need to present this week and this is the only part that’s missing.
thanks in advance
Jose