}
@Override
protected Socket createSocket(Service service) throws IOException {
Index indexObject = null;
Receiver receiver = null;
Socket socket = null;
if (index != null) {
indexObject = service.getIndexes().get(index);
if (indexObject == null) {
throw new RuntimeCamelException(String.format("cannot find index [%s]", index));
}
socket = indexObject.attach(args);
} else {
receiver = service.getReceiver();
socket = receiver.attach(args);
}
socket.setTcpNoDelay(true);
LOG.trace(String.format("created a socket on %s", socket.getRemoteSocketAddress()));
return socket;
}