class DiscoveredServiceWorkItemHandler implements WorkItemHandler {

    protected Map<String, Object> discoverAndCall(WorkItem workItem, String namespace, String serviceName, HttpMethods method) {
        Map<String, Object> data = new HashMap<>(workItem.getParameters());
        String service = (String) data.remove(serviceName);

        // remove all internal fields before sending
        INTERNAL_FIELDS.forEach(field -> data.remove(field));

        // discover service endpoint
        ServiceInfo endpoint = serviceEndpoints.computeIfAbsent(service, (s) -> findEndpoint(namespace, s));
        LOGGER.debug("Found endpoint for service {} with location {}", service, endpoint);

        RequestBody body = produceRequestPayload(data);
        Request request = null;

        switch (method) {
            case POST:
                request = producePostRequest(endpoint, body);
                break;
            case GET:
                request = produceGetRequest(endpoint);
                break;
            case PUT:
                request = producePutRequest(endpoint, body);
                break;
            case DELETE:
                request = produceDeleteRequest(endpoint, body);
                break;
            default:
                break;
        }

        try (Response response = this.buildHttpClient().newCall(request).execute()) {

            Map<String, Object> results = produceResultsFromResponse(response);

            return results;

        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public  DiscoveredServiceWorkItemHandler();
    protected  DiscoveredServiceWorkItemHandler(final KogitoKubeClient kubeClient);

}