Closed ts-00 closed 2 years ago
I'm not awary of any initial wait time
could you provide some logs that showcase this?
Call any method (for example, klines()) within a Junit-Test-case and you will see that there is always an initial wait time (which is always 20 seconds for any xchange method call ), for example:
@Test
final void callBinanceMethod() {
// setup connection
var conn = ExchangeFactory.INSTANCE.createExchange(BinanceExchange.class, apiKey, secretKey);
// call method (this method is only called after an initial delay of 20 seconds
var orderbook = conn.getMarketDataService().getOrderBook(...)
assertNotNull(orderbook);
}
I think this happens because of resilience4j which has an initial waitDuration by default.
Am curious if
conn.remoteInit();
shortcuts the delay you encounter.
Am curious if conn.remoteInit(); shortcuts the delay you encounter.
Good point. The conn.remoteInit();
(which is responsible for the delay) is called each time the BinanceExchange
is created because by default shouldLoadRemoteMetaData
is set to true.
// according to ExchangeSpecification.java
private boolean shouldLoadRemoteMetaData = true; // default value
Currently, when using xchange api (for example, binance xchange api) there is an initial wait time before the request is fired (because of resilience4j). Is there a way to disable this first inital wait time (first inital "waitDuration") or set it to a lower value?