Google Pubsub Subscriber startAsync NosuchmethodError

时间:2017-05-12 06:40:52

标签: google-cloud-pubsub

我的订户定义如下:

  class PubSubMessageReceiver extends MessageReceiver {
    override def receiveMessage(message: PubsubMessage, consumer: AckReplyConsumer): Unit = {
     // .. business logic
      //acknowledge message
      consumer.ack()
    }
  }

val subscriber = Subscriber.defaultBuilder(subscriptionName, new PubSubMessageReceiver).build()

但是,在调用subscriber.startAsync时,我收到以下错误:

java.lang.NoSuchMethodError: com.google.api.core.AbstractApiService$InnerService.startAsync()Lcom/google/common/util/concurrent/Service;
    at com.google.api.core.AbstractApiService.startAsync(AbstractApiService.java:121)
    at com.google.cloud.pubsub.spi.v1.Subscriber.startAsync(Subscriber.java:218)

1 个答案:

答案 0 :(得分:0)

我的运行时环境安装了旧版本的Guava。