Team, I believe the state feature is reset after w...
# help
d
Team, I believe the state feature is reset after we restart wiremock. Is there any way to store the state details over hard drives or similar ways?
l
I think at the moment only an in memory store is provided (Caffeine). You should be able to provide your own though by the look of it - https://github.com/wiremock/wiremock-state-extension?tab=readme-ov-file#java
👍 2
h
Thank you for the information @Lee Turner , may I know if persisting the data is possible in wiremock cloud solution? I'm asking this because the WireMock State extension seems works only for wiremock standalone mode.
l
Hi @Han Wang I see you have posted a separate question where Tom has answered you. Just for completeness - In WireMock Cloud, state is cache like so isn’t removed on a time basis, but is limited to 100k keys, beyond which they’re ejected on an LRU basis. Also, state is kept in temporary storage (cache) and cleared when e.g. a deployment happens. The design of the state feature is intended for short-lived stateful flows, so e.g. where a payment goes through several states during the course of executing a test case. At the end of the test case you’d either reset the state, or if it was associated with a data point created uniquely just let it be LRU’d out so that next time the test is run it’s from the base state.
h
Highly appreciated for your detailed information, it helps a lot @Lee Turner ! I'm thinking maybe these useful details could be exposed on the official document as well for those who have similar issues like me 😀
l
I will take a look at adding this information to the docs. We have just released a new docs site for Wiremock cloud so this will fit nicely.
❤️ 1