从 pub/sub 模拟器拉取消息时出现 java.lang.NullPointerException

问题描述 投票:0回答:1

我尝试使用 pub/sub 模拟器测试死信队列功能,但注意到消息未正确路由。模拟器似乎重试传递直至配置的最大尝试次数,然后挂起。

我尝试在达到最大尝试次数后从订阅中提取消息,但收到此错误。

遇到

[pubsub] java.lang.NullPointerException
[pubsub]        at com.google.cloud.pubsub.testing.v1.MessageBacklog.pull(MessageBacklog.java:302)
[pubsub]        at com.google.cloud.pubsub.testing.v1.OrderedMessageBacklog.pullFromBacklogs(OrderedMessageBacklog.java:323)
[pubsub]        at com.google.cloud.pubsub.testing.v1.OrderedMessageBacklog.pull(OrderedMessageBacklog.java:181)
[pubsub]        at com.google.cloud.pubsub.testing.v1.OrderedMessageBacklog.pull(OrderedMessageBacklog.java:169)
[pubsub]        at com.google.cloud.pubsub.testing.v1.FakePubsubServer.pull(FakePubsubServer.java:1482)
[pubsub]        at com.google.cloud.pubsub.testing.v1.PubsubGrpcServerAdapter$2.pull(PubsubGrpcServerAdapter.java:349)
[pubsub]        at com.google.pubsub.v1.SubscriberGrpc$MethodHandlers.invoke(SubscriberGrpc.java:2037)
[pubsub]        at io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:182)
[pubsub]        at io.grpc.PartialForwardingServerCallListener.onHalfClose(PartialForwardingServerCallListener.java:35)
[pubsub]        at io.grpc.ForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:23)
[pubsub]        at io.grpc.ForwardingServerCallListener$SimpleForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:40)
[pubsub]        at io.grpc.Contexts$ContextualizedServerCallListener.onHalfClose(Contexts.java:86)
[pubsub]        at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:351)
[pubsub]        at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:860)
[pubsub]        at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
[pubsub]        at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
[pubsub]        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[pubsub]        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[pubsub]        at java.base/java.lang.Thread.run(Thread.java:829)
[pubsub] 
[pubsub] Mar 01, 2024 6:08:18 PM io.gapi.emulators.netty.HttpHandler$1 onError

我希望消息被路由到设置的死信主题,并且模拟器在拉取消息时不会崩溃。

google-cloud-pubsub google-cloud-pubsub-emulator
1个回答
0
投票

如果崩溃发生在模拟器本身,那么可能是某种需要解决的边缘情况。您应该输入支持案例或在问题跟踪器中添加票证,其中包含重现问题的确切步骤。

© www.soinside.com 2019 - 2024. All rights reserved.