My "queryService.query()" make take a time that exceeds a limit specified by the requirement. I want to be able to skip the execution of the current function all after 1 second and then continue to process of the next "inputInfo". If a task takes too long, I want to skip it. What's the best way to do this?
public Response getResponse(InputInfo inputInfo) {
Preconditions.checkNotNull(inputInfo);
LOGGER.info("inputInfo: " + inputInfo);
Response response = queryService.query(inputInfo);
return response;
}