Connecting multiple couchbase servers from single JVM

Hello,
We have a vert.x application wherein we have multiple verticles connecting to different clusters of couchbase servers in a single JVM.
Couchbase recommends creating only one environment per JVM, how do we manage multiple clusters in single JVM where they can have different connection parameters?

Thanks,
Vijay

Hi Vijay,

As you mentioned, the recommended approach is to create one CouchbaseEnvironment and then reuse it when creating each Cluster. There’s some example code in the SDK documentation that shows how to do this.

If your clusters need to have different environment properties (that is, if they require the environment to be configured differently) then I think the best you can do is ignore the warning and create multiple environments.

Thanks,
David N