From 137391fb1137c4d4986b47411ffcc57e4e9bacd0 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Tue, 17 Apr 2018 11:35:47 -0700 Subject: Upgrade pubsub dependency (#156) --- build.sbt | 2 +- src/main/scala/xyz/driver/core/pubsub.scala | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build.sbt b/build.sbt index 9f1a562..ea6af52 100644 --- a/build.sbt +++ b/build.sbt @@ -22,7 +22,7 @@ lazy val core = (project in file(".")) "com.beachape" %% "enumeratum" % "1.5.13", "org.mockito" % "mockito-core" % "1.9.5" % Test, "com.amazonaws" % "aws-java-sdk-s3" % "1.11.26", - "com.google.cloud" % "google-cloud-pubsub" % "0.25.0-beta", + "com.google.cloud" % "google-cloud-pubsub" % "0.42.1-beta", "com.google.cloud" % "google-cloud-storage" % "1.24.1", "com.typesafe" % "config" % "1.3.1", "ch.qos.logback" % "logback-classic" % "1.1.11", 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() -- cgit v1.2.3