I would like to know how to perform a task in the background every x-minutes with Gatling.
Background: I want to write a couple of scenario's on our backend. Our backend will be called by another backend in this case. A usual scenario:
- client (backend) to server authentication (optional)
- client requests X
- client requests Y
- client requests Z
I want a scenario where requests 'X, Y and Z' are performed.
The problem: The backend(client) to backend (server) authentication is performed with accessTokens. This accesToken will expire a couple of times within a total simulation, however I dont want to do this authentication every scenario. (since that might than be the bottleneck). For example : the token expires every 10 minutes, a scenario takes 5 seconds, and the total simulation will be 2 hours.
Question: How can I create a simulation that will refresh the accesstoken on the background every 10 minutes. In a real-life scenario the backend(client) will just have a background process that updates the accesToken (in memory, or shared, state) every 10 mins. Once again: I don't want to re-authenticate every scenario (call X, call Y, call Z).