Google Pubsub:无法使用:该服务无法满足您的请求 [英] Google Pubsub: UNAVAILABLE: The service was unable to fulfill your request

查看:125
本文介绍了Google Pubsub:无法使用:该服务无法满足您的请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Java库从我的代码中订阅订阅.使用sbt: "com.google.cloud" % "google-cloud-pubsub" % "0.24.0-beta"

I am using the java library to subscribe to a subscription from my code. Using sbt: "com.google.cloud" % "google-cloud-pubsub" % "0.24.0-beta"

我按照此指南编写了订阅者: https://cloud.google.com/pubsub /docs/pull

I followed this guide to write a subscriber: https://cloud.google.com/pubsub/docs/pull

 val projectId = "test-topic"
 val subscriptionId = "test-sub"

def main(args: Array[String]): Unit = {
 val subscriptionName = SubscriptionName.create(projectId, subscriptionId)
 val subscriber = Subscriber.defaultBuilder(subscriptionName, new PastEventMessageReceiver()).build()
 subscriber.startAsync()
 System.in.read()
}


class PastEventMessageReceiver extends MessageReceiver {
  override def receiveMessage(message: PubsubMessage, consumer: AckReplyConsumer): Unit = {
  println(message)
  consumer.ack()
}

效果很好,我能够提取已发布的消息,但每分钟多次在我的日志中不断看到此错误.

It works great, I am able to pull published messaged but I keep seeing this error in my log multiple times per minute.

 com.google.cloud.pubsub.v1.StreamingSubscriberConnection$1 onFailure
WARNING: Terminated streaming with exception
io.grpc.StatusRuntimeException: UNAVAILABLE: The service was unable to fulfill your request. Please try again. [code=8a75]
    at io.grpc.Status.asRuntimeException(Status.java:526)
    at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:385)
    at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:422)
    at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:61)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:504)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$600(ClientCallImpl.java:425)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:536)
    at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
    at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:102)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

当我第一次运行该应用程序时,有一个小的延迟(大约1-2分钟),我没有看到该错误,在延迟之后,我每分钟看到多次.我的应用程序似乎仍然能够轻松发送消息.

When I first run the app there is a small delay (around 1-2 mins) where I don't see that error, after the delay I see it multiple times per minute. My application seems to still able to pull messages tough.

推荐答案

此消息是Google Cloud Pub/Sub库中的内部错误,当发送到Pub/Sub的请求中存在断开连接或可重试错误时,就会发生此错误服务器.客户端库应无缝地重新创建连接,并针对这些错误重试请求.在客户端库的0.26.0-beta版本和更高版本中,除非您

This message is an internal error in the Google Cloud Pub/Sub library that happens when there is a disconnection or retryable error in a request sent to the Pub/Sub server. The client library should seamlessly recreate connections and retry requests on these errors. In version 0.26.0-beta and later of the client library, these errors should no longer print out in the log unless you have the log level set to FINE. In general, messages should still continue to be sent to your MessageReceiver after this error occurs. Any error that is not retryable by the client library itself, e.g., when a subscription is not found, is propagated back to the caller.

这篇关于Google Pubsub:无法使用:该服务无法满足您的请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆