Gatling custom action need

ram2
Thu, 06 Nov 2025 21:07:58 +0000
Gatling (Open-Source)

Gatling version: 3.14.7
Gatling flavor: java
Gatling build tool: gradle

Hi,

Question 1: can we write async code or completable future function call on .exec?

I’m writing custom Gatling actions in Java to test a system with multiple microservices. My main goal is to accurately track the end-to-end response time, specifically from when a Kafka message is sent to when a response is received via socketio.
I’m currently implementing custom actions for both Kafka producer and socket io client. However, I’m wondering:
Is it necessary to create a separate custom Gatling Action for each step (Kafka send, socket io receive), or can I just call my Java functions directly in .exec and use a single custom action to log the send/receive metrics?
What are the advantages of using custom actions for each operation versus just using Java functions in .exec?
I only need the metrics for the total time between send and receive, so I’m trying to understand the best practice for this scenario.

3 posts - 3 participants