aboutsummaryrefslogtreecommitdiff
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
parent4a769764836a14ca3afa4d6a6f7f09943e290ec2 (diff)
downloaddriver-core-137391fb1137c4d4986b47411ffcc57e4e9bacd0.tar.gz
driver-core-137391fb1137c4d4986b47411ffcc57e4e9bacd0.tar.bz2
driver-core-137391fb1137c4d4986b47411ffcc57e4e9bacd0.zip
Upgrade pubsub dependency (#156)v1.8.22
-rw-r--r--build.sbt2
-rw-r--r--src/main/scala/xyz/driver/core/pubsub.scala12
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()