Verify how headers are passed to Grpc calls in Gatling 3.15.0

Gatling version: 3.15.0
Gatling flavor: java kotlin scala javascript typescript
Gatling build tool: maven gradle sbt bundle npm

I made sure I’ve update my Gatling version to the latest release
I read the guidelines and how to ask a question topics.
I provided a SSCCE (or at least, all information to help the community understand my topic)
I copied output I observe, and explain what I think should be.

Hello,

I would like to express my questions since I upgraded the Gatling version to 3.15.0 and I am having problems to pass headers to Grpc calls.

In the previous version that I was working with (3.13.5) it was possible to pass headers by doing:

        GrpcProtocolBuilder protocol = GrpcSecurityMode.valueOf(certificateValidationMethod).getGrpcProtocol(configProperties).asciiHeaders(hs);

So the .asciiHeaders methods was adding the required headers for Grpc call.

In newest version I cannot find the method asciiHeaders in class
io.gatling.javaapi.grpc.GrpcProtocolBuilder

to pass the list of headers that I have.

After a lot of research I have found that

GrpcDsl.grpc("External Query-" + scenario.getScenarioID())
        // Defines the gRPC method for server streaming
        .serverStream(QueryChannelServiceGrpc.getQueryMethod())

after serverStream I do have available .asciiHeaders method.

Initially and after a lot of search I haven’t found the method I just explained.

Could you please explain this is the correct way to pass the headers in Gatling 3.15.0?

Thanks in advance,

Michalis.

Hello,

Please check:

Regards

1 Like

Many thanks for your immediate response. I really appreciate this.

Also, look at servers configurations: Gatling gRPC protocol reference - protocol configuration

Previously all settings were defined globally with the grpc variable but that made handling multiple gRPC servers in the same scenario impossible. Now you can define one or multiple server configurations and feed them to the main protocol definition using grpc.serverConfiguration("name").asciiHeaders(…)… and grpc.serverConfigurations(…).

1 Like