Hi, I'm trying to see if it's possible to record g...
# help
l
Hi, I'm trying to see if it's possible to record gRPC traffic using Wiremock. It seems to me that we would have to manually prepare the stubs (which is a pain). Any pointers will be greatly appreciated. Thank you!
t
The latest version of the gRPC extension released a few days ago added recording support. You should be able to start recording as usual, specifying a gRPC service as the target.
l
That is a perfect timing. Thank you! To enable the recording, are we going to do the same as we do for HTTP requests recording? I'm using the docker image with gRPC extension. Earlier I would run something like:
Copy code
docker run -d \
  --name wiremock \
  -p 8080:8080 \
  -v $(pwd)/wiremock:/home/wiremock \
  wiremock/wiremock:3.13.1 \
  --proxy-all="https://<endpoint>" \
  --record-mappings \
  --verbose
Then I will start the recording. Does that look ok?
t
That’s the deprecated way of recording, so it won’t work. You need to start and stop recording either via the API or the recording page.
l
Got it. It must be something like this:
Copy code
curl -X POST <http://localhost:8080/__admin/recordings/start>   -H "Content-Type: application/json"   -d '{
    "targetBaseUrl": "https://<endpoint>",
    "captureHeaders": {
      "Accept": {},
      "Content-Type": {}
    }
  }'
because I figured adding
record-mappings
doesn't do it.
👍 1