CouchbaseEnvironment for two clusters

I have two clusters (cluster1 - v3.0.2 and cluster2 - v4.0.0), on cluster1 I’m using n1ql and on cluster2 I’m using only for view for getting data, how I must configure CouchbaseEnvironment in this case?
here is how i’m doing it:

Builder envBuilder = DefaultCouchbaseEnvironment.builder();
            if (null != couchbaseConnectionTimeOut) {
                if (timeout > 0) {
                    envBuilder.connectTimeout(timeout);
                } else if (timeout < 0) {
                    logger.warn("....");
                }
            }
            if (null != isSupportQuery && !isSupportQuery.isEmpty()) {
                boolean isSupportQueryBoolean = Boolean.parseBoolean(isSupportQuery);
                if (isSupportQueryBoolean) {
                    envBuilder.queryEnabled(isSupportQueryBoolean);
                }
            }

            if (null != couchbaseQueryPort && !couchbaseQueryPort.isEmpty()) {
                int queryPort = 0;
                try {
                    queryPort = Integer.parseInt(couchbaseQueryPort);
                } catch (NumberFormatException ex) {
                    logger.warn("...");
                }
                if (queryPort > 0) {
                    envBuilder.queryPort(queryPort);
                }
            }
            
            envBuilder.kvTimeout(10_000);   // default value 2500 in milliseconds
            
            this.env = envBuilder.build();

As I understand if I want use n1ql envBuilder.queryEnabled() must be true, otherwise false, so in my case I must use two instances of CouchbaseEnvironment?
If envBuilder.queryEnabled() = true for two clusters then I get this error:

2015-12-07 09:21:24,252 WARN [cb-io-1-15] com.couchbase.client.core.endpoint.Endpoint  - [null][QueryEndpoint]: Could not connect to endpoint, retrying with delay 1024 MILLISECONDS:
java.net.ConnectException: Connection refused: dnsName_server3/172.24.4.103:8093
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
        at com.couchbase.client.deps.io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:224)
        at com.couchbase.client.deps.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:289)
        at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:528)
        at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
        at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
        at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
        at com.couchbase.client.deps.io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
        at com.couchbase.client.deps.io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
        at java.lang.Thread.run(Thread.java:745)

CouchbaseEnvironment:

2015-12-07 09:21:22,139 INFO [main] com.couchbase.client.core.CouchbaseCore - CouchbaseEnvironment: {sslEnabled=false, sslKeystoreFile='null', sslKeystorePassword='null', queryEnabled=true, queryPort=8093, bootstrapHttpEnabled=true, bootstrapCarrierEnabled=true, bootstrapHttpDirectPort=8091, bootstrapHttpSslPort=18091, bootstrapCarrierDirectPort=11210, bootstrapCarrierSslPort=11207, ioPoolSize=16, computationPoolSize=16, responseBufferSize=16384, requestBufferSize=16384, kvServiceEndpoints=1, viewServiceEndpoints=1, queryServiceEndpoints=1, ioPool=NioEventLoopGroup, coreScheduler=CoreScheduler, eventBus=DefaultEventBus, packageNameAndVersion=couchbase-jvm-core/1.2.2 (git: 1.2.2-dirty), dcpEnabled=false, retryStrategy=BestEffort, maxRequestLifetime=75000, retryDelay=ExponentialDelay{growBy 1.0 MICROSECONDS; lower=100, upper=100000}, reconnectDelay=ExponentialDelay{growBy 1.0 MILLISECONDS; lower=32, upper=4096}, observeIntervalDelay=ExponentialDelay{growBy 1.0 MICROSECONDS; lower=10, upper=100000}, keepAliveInterval=30000, autoreleaseAfter=2000, bufferPoolingEnabled=true, tcpNodelayEnabled=true, mutationTokensEnabled=false, socketConnectTimeout=1000, dcpConnectionBufferSize=20971520, dcpConnectionBufferAckThreshold=0.2, queryTimeout=75000, viewTimeout=75000, kvTimeout=10000, connectTimeout=5000, disconnectTimeout=25000, dnsSrvEnabled=false}

Hi, no queryEnabled is now deprecated. This was only in place for pre 4.0 testing code which used cbq-engine separately.

Just leave it unset and the client will enable it for the 4.0 one but not for 3.x

I think it would make more sense to use the 4.0 node for N1QL and 3.0 node for Views (your message hinted your doing the reverse), in which case you can leave queryEnabled unset, each Cluster will configure correctly and the one connected to CB 4.0 will be able to deal with N1QL queries.