Google cloud platform 在来自google pubsub的轮询消息中未找到资源

Google cloud platform 在来自google pubsub的轮询消息中未找到资源,google-cloud-platform,google-cloud-pubsub,Google Cloud Platform,Google Cloud Pubsub,我在google pub/sub上的一个服务帐户上创建了两个主题(q_0和q_abc)。当我阅读来自q_0的消息时,它工作正常,但当从q_abc进行轮询时,我得到以下异常。两个队列都具有相同的权限 Sep 30, 2019 3:23:51 PM com.google.cloud.pubsub.v1.StreamingSubscriberConnection$1 onFailure SEVERE: terminated streaming with exception com.google.api

我在google pub/sub上的一个服务帐户上创建了两个主题(q_0和q_abc)。当我阅读来自q_0的消息时,它工作正常,但当从q_abc进行轮询时,我得到以下异常。两个队列都具有相同的权限

Sep 30, 2019 3:23:51 PM com.google.cloud.pubsub.v1.StreamingSubscriberConnection$1 onFailure
SEVERE: terminated streaming with exception
com.google.api.gax.rpc.NotFoundException: com.google.api.gax.rpc.NotFoundException: io.grpc.StatusRuntimeException: NOT_FOUND: Resource not found (resource=q_abc).
    at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:45)
    at com.google.cloud.pubsub.v1.StreamingSubscriberConnection$1.onFailure(StreamingSubscriberConnection.java:238)
    at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:68)
    at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1341)
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:398)
    at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1027)
    at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:868)
    at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:713)
    at com.google.api.core.AbstractApiFuture$InternalSettableFuture.setException(AbstractApiFuture.java:95)
    at com.google.api.core.AbstractApiFuture.setException(AbstractApiFuture.java:77)
    at com.google.api.core.SettableApiFuture.setException(SettableApiFuture.java:52)
    at com.google.cloud.pubsub.v1.StreamingSubscriberConnection$StreamingPullResponseObserver.onError(StreamingSubscriberConnection.java:174)
    at com.google.api.gax.tracing.TracedResponseObserver.onError(TracedResponseObserver.java:103)
    at com.google.api.gax.grpc.ExceptionResponseObserver.onErrorImpl(ExceptionResponseObserver.java:84)
    at com.google.api.gax.rpc.StateCheckingResponseObserver.onError(StateCheckingResponseObserver.java:86)
    at com.google.api.gax.grpc.GrpcDirectStreamController$ResponseObserverAdapter.onClose(GrpcDirectStreamController.java:149)
    at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
    at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
    at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
    at io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:700)
    at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
    at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
    at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
    at io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:399)
    at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:510)
    at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:66)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:630)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:518)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:692)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:681)
    at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
    at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
    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:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: com.google.api.gax.rpc.NotFoundException: io.grpc.StatusRuntimeException: NOT_FOUND: Resource not found (resource=q_abc).
    at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:45)
    at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:72)
    at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:60)
    at com.google.api.gax.grpc.ExceptionResponseObserver.onErrorImpl(ExceptionResponseObserver.java:82)
    ... 25 more
Caused by: io.grpc.StatusRuntimeException: NOT_FOUND: Resource not found (resource=q_abc).
    at io.grpc.Status.asRuntimeException(Status.java:533)
    ... 24 more

有人可以帮助解决此问题吗?

要确保主题确实是由Google Cloud Pub/Sub创建的,您可以在命令行中运行以下命令:

gcloud pubsub topics list

请告诉我这个话题是否真的存在。为了找到问题的根源,我们必须一步一步地进行故障排除。

在您需要为pubsub主题创建订阅之前,请在资源名称中输入此订阅者的名称。

是的,在cloud shell上运行上述命令时,我检查了主题是否存在。您好,你能分享一些你设置主题的方式的证据吗?请分享你的代码片段。另外,我希望在您运行我在过去的评论中与您共享的命令时看到结果。很明显,Pub/Sub没有意识到这个主题,但我想对这个问题有一个更好的看法。它现在运行良好……在轮询之前,我们必须在谷歌云平台上注册订阅id