I've got some legacy code, where I need to use the Google Pubsub old API Google_Service_Pubsub_Topics_Resource to publish a message. How do I add attributes to the message? I keep getting an error:
(publish) unknown parameter: 'myattr'
Here's the code:
$pubsubService = new Google_Service_Pubsub($client);
$req = new Google_Service_Pubsub_PublishRequest();
$req->setTopic("testtopic");
$msg = new Google_Service_Pubsub_PubsubMessage();
$msg->setData("....");
$req->setMessage($msg);
$opts = array(
"myattr" => "test"
);
$ret = $pubsubService->topics->publish($req, $opts);