@Override
public void onConnect(WebSocketClient client) {
try {
logger.info("sending some index requests (longer than a single bulk size)");
for (int i = 0; i < 250; i++) {
clientFactory.indexRequest()
.data(jsonBuilder()
.startObject()
.field("index", "test")
.field("type", "test")
.field("id", Integer.toString(i))