Hi everyone, how are you? I have a question: Is t...
# help
Hi everyone, how are you? I have a question: Is there a way to use only the Wiremock engine? I need to save the Wiremock Stub (JSON) in a database, read the JSON and after use Wiremock engine for matching and getting the correct response.
Hi, I am not sure I fully understand your requirement. Are you saying that you want to use WireMock but store the stub json in a DB instead of the file system?
I need to use just the Wiremock engine
@Lee Turner instead to get from filesystem get from database, there are this possibility?
I am not sure there is a database store implementation for WireMock. I haven't seen one. There shouldn't be any reason why it couldn't be implemented if you were that way inclined.
What is the step to implement it? Create an issue and after a pull request?
If it is persistent stubs that you are looking for, you might want to take a look at WireMock Cloud. That would give you the persistent stubs you are looking for along with a number of other features over and above the open source version such as mock creation from openAPI spec, Chaos testing, contract testing and import data from CSV files https://www.wiremock.io/comparison
If you were to implement this yourself I would look at putting a WireMock extension together that implements this feature
If you wanted to roll your own db implementation, I believe you can use the
interface, but it’s still in beta when I last checked: > `Stores`: the root interface for gaining access to the various stores of WireMock’s state and creating/using custom stores. https://wiremock.org/docs/extending-wiremock/ Something I looked at but never got around to implementing. We basically just map the persistent rules into a container and it works quite well
👍 2