Skip to content

Commit d0290ef

Browse files
committed
Add options on the service builder directly
1 parent 5a3b60c commit d0290ef

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/ContinuousPipe/Message/GooglePubSub/PubSubMessagePuller.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
use ContinuousPipe\Message\MessageException;
77
use ContinuousPipe\Message\MessagePuller;
88
use Google\Cloud\Core\Exception\GoogleException;
9+
use Google\Cloud\Core\ServiceBuilder;
910
use Google\Cloud\PubSub\Connection\ConnectionInterface;
1011
use Google\Cloud\PubSub\Subscription;
11-
use Google\Cloud\ServiceBuilder;
1212
use JMS\Serializer\Exception\Exception as SerializerException;
1313
use JMS\Serializer\SerializerInterface;
1414
use Psr\Log\LoggerInterface;
@@ -47,13 +47,14 @@ public function __construct(SerializerInterface $serializer, LoggerInterface $lo
4747
{
4848
$this->serializer = $serializer;
4949
$this->topicName = $topicName;
50-
$this->serviceBuilder = new ServiceBuilder([
51-
'projectId' => $projectId,
52-
'keyFilePath' => $keyFilePath,
53-
]);
5450
$this->subscriptionName = $subscriptionName;
5551
$this->logger = $logger;
5652
$this->options = $options;
53+
54+
$this->serviceBuilder = new ServiceBuilder([
55+
'projectId' => $projectId,
56+
'keyFilePath' => $keyFilePath,
57+
] + $options);
5758
}
5859

5960
public function pull(): \Generator
@@ -108,7 +109,7 @@ public function modifyDeadline(string $acknowledgeIdentifier, int $seconds)
108109

109110
private function getSubscription(): Subscription
110111
{
111-
$pubSub = $this->serviceBuilder->pubsub($this->options);
112+
$pubSub = $this->serviceBuilder->pubsub();
112113

113114
return $pubSub->subscription($this->subscriptionName);
114115
}

0 commit comments

Comments
 (0)