Jmeter gRPC 采样器抛出错误:GRPCSampler 解析异常

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

使用 JMeter gRPC 采样器时,即 GRPC Request 出现错误,enter image description here GRPCSampler 解析异常:发起 GRPC 请求之前发生未知异常,请参阅响应正文以获取堆栈跟踪。

java.lang.IllegalStateException
    at com.google.common.base.Preconditions.checkState(Preconditions.java:495)
    at com.google.common.net.HostAndPort.getPort(HostAndPort.java:110)
    at vn.zalopay.benchmark.core.grpc.ChannelFactory.createChannelBuilder(ChannelFactory.java:51)
    at vn.zalopay.benchmark.core.grpc.ChannelFactory.createChannel(ChannelFactory.java:39)
    at vn.zalopay.benchmark.core.ClientCaller.createDynamicClient(ClientCaller.java:154)
    at vn.zalopay.benchmark.core.ClientCaller.init(ClientCaller.java:96)
    at vn.zalopay.benchmark.core.ClientCaller.<init>(ClientCaller.java:53)
    at vn.zalopay.benchmark.GRPCSampler.initGrpcClient(GRPCSampler.java:81)
    at vn.zalopay.benchmark.GRPCSampler.initGrpcInCurrentThread(GRPCSampler.java:203)
    at vn.zalopay.benchmark.GRPCSampler.initGrpcRequestSampler(GRPCSampler.java:133)
    at vn.zalopay.benchmark.GRPCSampler.sample(GRPCSampler.java:90)
    at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651)
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570)
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268)
    at java.lang.Thread.run(null:-1)

我已经在 Asp.net 中使用以下 .proto 文件创建了一个服务

syntax = "proto3";

option csharp_namespace = "GrpcGreeter";

package greet;

// The greeting service definition.
service Greeter {
  // Sends a greeting
  rpc SayHello (HelloRequest) returns (HelloReply);
}

// The request message containing the user's name.
message HelloRequest {
  string name = 1;
}

// The response message containing the greetings.
message HelloReply {
  string message = 1;
}

我尝试使用插件(即 GRPC Request)在 JMeter 中运行它,但我收到状态代码 400 并出现上述错误。

enter image description here

@德米特里T

jmeter protocol-buffers grpc
1个回答
0
投票

我认为您需要从“服务器名称或 IP”输入中删除

http://
,您应该在那里提供 IP 地址DNS 主机名

接下来考虑启用 JMeter 调试日志记录,这样您将获得更多信息,从而可以快速找到问题的根本原因。

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