|
6 | 6 | use ContinuousPipe\Message\MessageException;
|
7 | 7 | use ContinuousPipe\Message\MessagePuller;
|
8 | 8 | use Google\Cloud\Core\Exception\GoogleException;
|
| 9 | +use Google\Cloud\Core\ServiceBuilder; |
9 | 10 | use Google\Cloud\PubSub\Connection\ConnectionInterface;
|
10 | 11 | use Google\Cloud\PubSub\Subscription;
|
11 |
| -use Google\Cloud\ServiceBuilder; |
12 | 12 | use JMS\Serializer\Exception\Exception as SerializerException;
|
13 | 13 | use JMS\Serializer\SerializerInterface;
|
14 | 14 | use Psr\Log\LoggerInterface;
|
@@ -47,13 +47,14 @@ public function __construct(SerializerInterface $serializer, LoggerInterface $lo
|
47 | 47 | {
|
48 | 48 | $this->serializer = $serializer;
|
49 | 49 | $this->topicName = $topicName;
|
50 |
| - $this->serviceBuilder = new ServiceBuilder([ |
51 |
| - 'projectId' => $projectId, |
52 |
| - 'keyFilePath' => $keyFilePath, |
53 |
| - ]); |
54 | 50 | $this->subscriptionName = $subscriptionName;
|
55 | 51 | $this->logger = $logger;
|
56 | 52 | $this->options = $options;
|
| 53 | + |
| 54 | + $this->serviceBuilder = new ServiceBuilder([ |
| 55 | + 'projectId' => $projectId, |
| 56 | + 'keyFilePath' => $keyFilePath, |
| 57 | + ] + $options); |
57 | 58 | }
|
58 | 59 |
|
59 | 60 | public function pull(): \Generator
|
@@ -108,7 +109,7 @@ public function modifyDeadline(string $acknowledgeIdentifier, int $seconds)
|
108 | 109 |
|
109 | 110 | private function getSubscription(): Subscription
|
110 | 111 | {
|
111 |
| - $pubSub = $this->serviceBuilder->pubsub($this->options); |
| 112 | + $pubSub = $this->serviceBuilder->pubsub(); |
112 | 113 |
|
113 | 114 | return $pubSub->subscription($this->subscriptionName);
|
114 | 115 | }
|
|
0 commit comments