Hi I have installed google pubsub library via composer in Laravel Framework
$ composer require google/cloud
Is this the right library for laravel framework. Has anyone used this library and successfully implemented pubsub.
Then I have created the topics and subscription. The Subscription is set as push. Then When I tried to publish the message, I am getting error. In google, I can't find such error been repeated. Here is my code.
use Google\Cloud\PubSub\PubSubClient;
$pubsub = new PubSubClient([
"projectId" => $projectId
]);
// Get an instance of a previously created topic.
$topic = $pubSub->topic('my_topic');
// Publish a message to the topic.
$topic->publish(['data' => 'My new message.']);