wiremock

WIremock callback to Kafka


is there any way to make Wiremock send callback to kafka?

currently i created this one, but it for Rest API, is there something serveEventListeners for sending to kafka?

Thankyou!

{
    "request": {
        "urlPath": "/something-async",
        "method": "POST"
    },
    "response": {
        "status": 200,
        "body": "{ \"result\": \"SUCCESS BRO\" }"
    },
    "serveEventListeners": [
        {
            "name": "webhook",
            "parameters": {
                "method": "POST",
                "url": "https://reqres.in/api/users",
                "headers": {
                    "Content-Type": "application/json"
                },
                "body": "{\"name\":\"juragan\",\"job\":\"jaga empang\"}"
            }
        }
    ]
}

Solution

  • I think you posted this question on the WireMock community slack channel also but I thought I would follow up here as well.

    At the time of writing, there aren't any extensions that either listen or publish to kafka topics. This could certianly be done by writing your own serve event listener implementation that posts Kafka messages. The official kafka java client would be a good place to start and there is also an extension template to get you started.

    https://github.com/wiremock/wiremock-extension-template