Replies: 3 comments 2 replies
-
小白还想请教一下为啥这个地方会出错呢?看代码应该是获取客户端的信息吧? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Is this problem solved? I also encountered this problem, can you tell me how you solved it? |
Beta Was this translation helpful? Give feedback.
1 reply
-
I also encountered this problem, can you tell me how you solved it? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
grpc拉取时返回CODE: INTERNAL_SERVER_ERROR, MESSAGE: null. NullPointerException. org.apache.rocketmq.proxy.grpc.v2.consumer.ReceiveMessageActivity.receiveMessage(ReceiveMessageActivity.java:66)
查看ReceiveMessageActivity.java:66代码
Settings settings = this.grpcClientSettingsManager.getClientSettings(ctx);
Subscription subscription = settings.getSubscription();
查看getClientSettings方法
public Settings getClientSettings(ProxyContext ctx) {
String clientId = ctx.getClientID();
Settings settings = getRawClientSettings(clientId);
if (settings == null) {
return null;
}
if (settings.hasPublishing()) {
settings = mergeProducerData(settings);
} else if (settings.hasSubscription()) {
settings = mergeSubscriptionData(ctx, settings, settings.getSubscription().getGroup().getName());
}
return mergeMetric(settings);
}
感觉应该是 getClientSettings返回空导致 settings.getSubscription();调用时出现空指针异常,虽然对这段代码加入了try-catch,但是在调用settings.getSubscription();之前,先判断一下settings是否为空,如果为空打印一些日志直接返回,不进行后续操作会比较好一点呢?
Beta Was this translation helpful? Give feedback.
All reactions