Async activity completion gives illegal wiretype error

Hello. I’m new to Temporal and trying to convert our existing Symfony workflow + AMQP to Temporal. Instead of trying to implement this in all microservices simultaneously, I’m using an Asynchronous Activity Completion to handle an usecase (publish message through AMQP, other microservice handles it when it has capacity and publishes a response message that is then handled by an AMQP consumer of this microservice).

I’m using code similar to AsyncActivityCompletion in samples-php. However, when I’m calling the ActivityCompletionClient’s ->completeByToken, the call fails with a proto: illegal wireType 7 (code: 2) exception. I’ve ensured my docker container has grpc & protobuf extensions installed & enabled.

To clarify:

  • I do have an AMQP consumer that on completion starts the workflow.
  • The workflow starts an async activity, this activity calls Activity::doNotCompleteOnReturn();.
  • The async activity published a json message which contains a field for base64_encode(Activity::getInfo()->taskToken)
  • The AMQP consumer that handles the response message reads that field and decodes it, then calls $workflowClient->newActivityCompletionClient()->completeByToken(base64_decode($message->getToken()), 'done');
  • This call just kept constantly looping, so I traced the code and in temporal-sdk in the BaseClient->invoke found the appropriate exception.
  • Using "temporal/sdk": "^2.5" in composer.json on PHP 8.2

Hi,

Have you checked if the actual sample work in your environment?

It was a different error actually, I was passing the wrong string. The “illegal wiretype 7” was really throwing me off there.