sdk-go icon indicating copy to clipboard operation
sdk-go copied to clipboard

Pubsub receiver sample with incomplete command to publish msg

Open FSMatias opened this issue 2 years ago • 0 comments

On the pubsub receiver sample, the instruction on how to publish the msg is missing the attributes. Without setting a few attribute arg. Without attributes, the code will fail with the following:

"failed to convert Message to Event: unknown Message encoding"

I recommend updating this line with something like the following:

gcloud pubsub topics publish demo_cloudevents --message='{"Hello": "world"}' --attribute=Content-Type="ap
plication/json",ce-specversion="1.0",ce-id="123",ce-type="example.type",ce-source="example/uri"

FSMatias avatar Jan 19 '23 14:01 FSMatias