Search in sources :

Example 1 with StaticPipelineFactory

use of com.hotels.styx.routing.StaticPipelineFactory in project styx by ExpediaGroup.

the class StyxPipelineFactory method configuredPipeline.

private RoutingObject configuredPipeline(RoutingObjectFactory.Context routingObjectFactoryContext) {
    boolean requestTracking = environment.configuration().get("requestTracking", Boolean.class).orElse(false);
    Optional<JsonNode> rootHandlerNode = environment.configuration().get("httpPipeline", JsonNode.class);
    if (rootHandlerNode.isPresent()) {
        return Builtins.build(List.of("httpPipeline"), routingObjectFactoryContext, toRoutingConfigNode(rootHandlerNode.get()));
    }
    Registry<BackendService> registry = (Registry<BackendService>) services.get("backendServiceRegistry");
    return new StaticPipelineFactory(environment, registry != null ? registry : new MemoryBackedRegistry<>(), plugins, executor, requestTracking).build();
}
Also used : StaticPipelineFactory(com.hotels.styx.routing.StaticPipelineFactory) BackendService(com.hotels.styx.api.extension.service.BackendService) JsonNode(com.fasterxml.jackson.databind.JsonNode) Registry(com.hotels.styx.api.extension.service.spi.Registry) MemoryBackedRegistry(com.hotels.styx.infrastructure.MemoryBackedRegistry)

Aggregations

JsonNode (com.fasterxml.jackson.databind.JsonNode)1 BackendService (com.hotels.styx.api.extension.service.BackendService)1 Registry (com.hotels.styx.api.extension.service.spi.Registry)1 MemoryBackedRegistry (com.hotels.styx.infrastructure.MemoryBackedRegistry)1 StaticPipelineFactory (com.hotels.styx.routing.StaticPipelineFactory)1