Han Wang
11/13/2024, 6:46 AMState values are ephemeral; they are stored in a Least Recently Used cache, and whilst WireMock Cloud makes a best effort attempt to maintain them no guarantee is made about their survival.
In order to prevent resource exhaustion we apply some limits.
Any state value cannot exceed 100,000 characters.
On Enterprise plans, up to 100,000 values can be defined before the least recently used values start being ejected from the store.
On other plans with Dynamic State enabled only 100 values are maintained in the store.
Could you please confirm if this means that as long as each individual value is under 100,000 characters and the total number of values stays within the specified limit, the persistence of state values is guaranteed by the LRU cache? Additionally, is there an expiration time for these values? If the LRU storage is part of the same service as the code logic, could the values be removed during a service rollout?
And I tried with my account ( I though it was supposed to be enterprise plan) , it seems the values count will be no more than 2040, is that another restriction?Han Wang
11/13/2024, 6:48 AMTom
11/13/2024, 9:31 AMHan Wang
11/13/2024, 11:50 AMcurl --location '<https://basketdemo1.wiremockapi.cloud/baskets/11/items>'
And following is the add item api to the existing basket:
curl --location '<https://basketdemo1.wiremockapi.cloud/baskets/11/items>' \
--header 'Content-Type: application/json' \
--data '{
"id": "20001",
"item": "name-20001",
"quantity": 20001
}'
step 1:
1. call the first api, there were 2040 items returned in total
2. call the second api, it will return 200, which indicates that item is added to the list
3. call the first api again, there was supposed to be 2041 items including the latest added one, but there was not
a note here is that this second API works well for the items added when the total number is less than 2040 , after the total number exceeds 2040, seems it is not able to expand anymore.Tom
11/13/2024, 2:28 PMTom
11/13/2024, 2:44 PMHan Wang
11/14/2024, 2:49 AMTom
11/14/2024, 9:48 AMTom
11/14/2024, 9:49 AMHan Wang
11/14/2024, 9:57 AMHan Wang
11/14/2024, 10:00 AMTom
11/14/2024, 11:05 AMHan Wang
11/14/2024, 12:52 PMHan Wang
11/14/2024, 12:54 PMTom
11/14/2024, 1:00 PMTom
11/14/2024, 1:00 PMHan Wang
11/14/2024, 1:03 PMTom
11/14/2024, 1:33 PMHan Wang
11/15/2024, 2:30 AMcurl --location '<https://wmc.wiremockapi.cloud/v1/mock-apis/6rk71/mappings>' \
--header 'Content-Type: application/json' \
--data '{
"request": {
"method": "GET",
"url": "/some/thing"
},
"response": {
"body": "Hello world!",
"headers": {
"Content-Type": "text/plain"
},
"status": 200
}
}'
Han Wang
11/18/2024, 3:54 AMRob Elliot
11/18/2024, 8:24 PMAuthorization: Token <api_token>
as the header. You can find your token here:
https://app.wiremock.cloud/account/securityTom
11/18/2024, 8:24 PMTom
11/18/2024, 8:24 PMRob Elliot
11/18/2024, 8:34 PMcurl --location '<https://api.wiremockapi.cloud/v1/mock-apis/6rk71/mappings>' \
--header 'Authorization: Token <api_token>' \
--header 'Content-Type: application/json' \
--data '{
"request": {
"method": "GET",
"url": "/some/thing"
},
"response": {
"body": "Hello world!",
"headers": {
"Content-Type": "text/plain"
},
"status": 200
}
}'