Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private ListenableFuture<ResponseEntity<classDtoR>> entity;
- @GetMapping("/begin")
- public void getValor() {
- AsyncRestTemplate restTemplate = new AsyncRestTemplate ();
- entity = restTemplate.getForEntity("http://localhost:8080/example/begin"
- ,classDtoR.class);
- }
- @GetMapping("/state")
- public boolean getValor1() {
- try {
- return entity.isDone();
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- @GetMapping("/result")
- public ResponseEntity<ConciliacionBancoDtoR> getValor2() {
- try {
- return entity.get();
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
Add Comment
Please, Sign In to add comment