@Override public boolean handleRequest( RequestContext context, DataApiRequest request, DruidAggregationQuery<?> druidQuery, ResponseProcessor response ) { WebServiceHandler handler = handlerSelector.select(druidQuery, request, context); // Add a timeout to the query if the selected webService is configured with one Integer timeout = handler.getWebService().getTimeout(); // Add a priority to the query if there is one configured Integer priority = handler.getWebService().getServiceConfig().getPriority(); QueryContext qc = druidQuery.getContext().withTimeout(timeout).withPriority(priority); if (!qc.isEmpty()) { druidQuery = druidQuery.withContext(qc); } return handler.handleRequest(context, request, druidQuery, response); } }