I’m trying to subscribe to 150 websocket market streams, but it always connects to exactly 64 streams. I tried Aggregate Trade Stream and Mark Price Stream and it always connects to 64 instead of 150.
I’m using the following lib:
log:
code:
package examples.um_futures.websocket;
import com.binance.connector.futures.client.impl.UMWebsocketClientImpl;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public final class MarkPriceStreamTest {
private final static List<String> symbols = new ArrayList<>();
public static void main(String[] args) throws InterruptedException, IOException {
loadSymbols();
UMWebsocketClientImpl client = new UMWebsocketClientImpl();
for (String symbol : symbols) {
Thread.sleep(300);
subscribe(client, symbol);
}
}
private static void subscribe(UMWebsocketClientImpl client, String symbol) {
client.markPriceStream(symbol, 3, ((event) -> {
System.out.println(symbol + " " + event);
}));
}
public static void loadSymbols() throws IOException {
InputStream inputStream = MarkPriceStreamTest.class.getResourceAsStream("/coins.txt");
assert inputStream != null;
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
while (reader.ready()) {
String symbol = reader.readLine();
symbols.add(symbol);
}
}
System.out.println("symbols read from file: " + symbols.size());
}
}
It’s not showing any errors in the logs. It simply does not connect after it reached 64 streams. Is there any limitation I might not aware of?
Thank you