davpin / cf-SpringBootTrader

Microservice version of the Spring Trader app using Spring Boot and Spring Cloud.
Apache License 2.0
104 stars 105 forks source link

Portofolio timeout retrieving quotes #31

Closed davpin closed 8 years ago

davpin commented 8 years ago

Portfolio is taking too long retrieving quotes which makes web timeout.

davpin commented 8 years ago

Portfolio is making 2 HTTP calls for each quote.

    @HystrixCommand(fallbackMethod = "setDefaultHolding")
    private void refreshHolding(Holding holding) {
        //Quote quote = quoteService.getQuote(holding.getSymbol());
        if (quoteService.getQuote(holding.getSymbol()).getStatus().equalsIgnoreCase(Quote.STATUS_SUCCESS)) {
            holding.setCurrentValue(new BigDecimal(quoteService.getQuote(holding.getSymbol()).getLastPrice()));
        }
    }

Introduced in a073f7e