我的订户定义如下:
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)
答案 0 :(得分:0)
我的运行时环境安装了旧版本的Guava。