I have a simple spring-boot
application which connects with mongodb and expose data. Here is my controller.
@RequestMapping(value = "/{coll}", method = RequestMethod.GET)
public List<Map> retrieveMongoData(@PathVariable("collection") String collection ,
@RequestParam Map<String,String> requestParams) throws Exception{
Query query = new Query();
........
return mongoTemplate.find(query, Map.class, collection);
}
Now I need to add request timeouts to the REST API. Here explains a solution with return Callable
.
In my case I return List<Map>
in my controller. How I can implement time-out functionality while complying with my controller.
>`? Is that what you’re asking?
– Strelok Apr 02 '18 at 03:53