Spring Integration + Swagger

47 Views Asked by At

I am trying to integrate swagger in Spring Integration flow. I know there is no support for Spring integration by swagger, but I am trying to do it manually. So, my approach is like, scan the endpoints from Integration flow along with the headers and append it in the swagger. But for the I couldn't fetch the endpoints from integration flow. I am using Spring integration DSL in which I cannot find the EndpointScanner Interface and any other concrete interfaces in dsl. Please help to find a solution.

public class MyEndpointScanner implements EndpointScanner {

    @Override
    public List<Endpoint> scanEndpoints(IntegrationFlow integrationFlow) {
        List<Endpoint> endpoints = new ArrayList<>();

        for (FlowStep flowStep : integrationFlow.getSteps()) {
            if (flowStep instanceof Endpoint) {
                endpoints.add((Endpoint) flowStep);
            }
        }

        List<Endpoint> filteredEndpoints = endpoints.stream()
                .filter(endpoint -> endpoint.getUrl().startsWith("/channels"))
                .collect(Collectors.toList());

        return filteredEndpoints;
    }
}

But the EndpointScanner is not available in Spring integration DSL.

0

There are 0 best solutions below