aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakob Odersky <jakob@odersky.com>2018-04-17 11:35:47 -0700
committerGitHub <noreply@github.com>2018-04-17 11:35:47 -0700
commit137391fb1137c4d4986b47411ffcc57e4e9bacd0 (patch)
treea45d53fa48e0931cc12af1a078301b717afdec99 /src
parent4a769764836a14ca3afa4d6a6f7f09943e290ec2 (diff)
downloaddriver-core-137391fb1137c4d4986b47411ffcc57e4e9bacd0.tar.gz
driver-core-137391fb1137c4d4986b47411ffcc57e4e9bacd0.tar.bz2
driver-core-137391fb1137c4d4986b47411ffcc57e4e9bacd0.zip
Upgrade pubsub dependency (#156)v1.8.22
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/xyz/driver/core/pubsub.scala12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/scala/xyz/driver/core/pubsub.scala b/src/main/scala/xyz/driver/core/pubsub.scala
index 149b0db..6d2667f 100644
--- a/src/main/scala/xyz/driver/core/pubsub.scala
+++ b/src/main/scala/xyz/driver/core/pubsub.scala
@@ -6,7 +6,7 @@ import akka.stream.Materializer
import com.google.api.core.{ApiFutureCallback, ApiFutures}
import com.google.cloud.pubsub.v1._
import com.google.protobuf.ByteString
-import com.google.pubsub.v1.{PubsubMessage, PushConfig, SubscriptionName, TopicName}
+import com.google.pubsub.v1._
import com.typesafe.scalalogging.Logger
import scala.concurrent.{ExecutionContext, Future, Promise}
@@ -28,7 +28,7 @@ object pubsub {
type Result = Id[PubsubMessage]
- private val topicName = TopicName.create(projectId, topic)
+ private val topicName = ProjectTopicName.of(projectId, topic)
private val publisher = {
if (autoCreate) {
@@ -38,7 +38,7 @@ object pubsub {
adminClient.createTopic(topicName)
}
}
- Publisher.defaultBuilder(topicName).build()
+ Publisher.newBuilder(topicName).build()
}
override def publish(message: Message): Future[Id[PubsubMessage]] = {
@@ -99,7 +99,7 @@ object pubsub {
)(implicit messageMarshaller: Unmarshaller[String, Message], mat: Materializer, ex: ExecutionContext)
extends PubsubSubscriber {
- private val subscriptionName = SubscriptionName.create(projectId, subscriptionId)
+ private val subscriptionName = ProjectSubscriptionName.of(projectId, subscriptionId)
private val messageReceiver = new MessageReceiver() {
override def receiveMessage(message: PubsubMessage, consumer: AckReplyConsumer): Unit = {
@@ -116,7 +116,7 @@ object pubsub {
val adminClient = SubscriptionAdminClient.create()
val subscriptionExists = Try(adminClient.getSubscription(subscriptionName)).isSuccess
if (!subscriptionExists) {
- val topicName = TopicName.create(projectId, subscriptionSettings.topic)
+ val topicName = ProjectTopicName.of(projectId, subscriptionSettings.topic)
adminClient.createSubscription(
subscriptionName,
topicName,
@@ -125,7 +125,7 @@ object pubsub {
}
}
- Subscriber.defaultBuilder(subscriptionName, messageReceiver).build()
+ Subscriber.newBuilder(subscriptionName, messageReceiver).build()
}
subscriber.startAsync()