for(final boolean useNagle : new boolean[] { false, true }) {
ConnectionFactory factory = new ConnectionFactory() {
{
setUri(uri);
setSocketConfigurator(new DefaultSocketConfigurator() {
@Override
public void configure(Socket socket) throws IOException {
socket.setTcpNoDelay(!useNagle);
socket.setReceiveBufferSize(bufferSize);
socket.setSendBufferSize(bufferSize);