eclipse-vertx / vertx-sql-client

High performance reactive SQL Client written in Java
Apache License 2.0
893 stars 201 forks source link

Oracle: io.vertx.core.VertxException: URLs with multiple hosts are not supported #1243

Open AbuzarHussain opened 2 years ago

AbuzarHussain commented 2 years ago

Version

vertx-oracle-client 4.3.2

Context

I'm unable to connect to the oracle instance with failover/clustering configuration. The connectionURI is constructed in EZConnect format and passed to fromUri() method, below is the example snippet,

const connectOptions = OracleConnectOptions.fromUri("oracle:thin:@host1,host2...hostn:port/service_name?failover=on&retry_count=30&retry_delay=10")
.setUser(username)
.setPassword(password)

 const poolOptions = new PoolOptions()
  .setMaxSize(maxPoolSize)
  .setShared(true)

 client = OraclePool.pool(vertx, connectOptions, poolOptions)

An exception is thrown : java.lang.IllegalArgumentException: Cannot parse invalid connection URI: oracle:thin:@host1,host2,host3,host4:port/service_name?failover=on&retry_count=30&retry_delay=10 -> at io.vertx.oracleclient.impl.OracleConnectionUriParser.parse(OracleConnectionUriParser.java:55) -> at io.vertx.oracleclient.impl.OracleConnectionUriParser.parse(OracleConnectionUriParser.java:28) -> at io.vertx.oracleclient.OracleConnectOptions.fromUri(OracleConnectOptions.java:89) -> at io.reactiverse.es4x.impl.EventEmitterImpl.emit(EventEmitterImpl.java:44) -> at io.reactiverse.es4x.ESVerticleFactory.waitFor(ESVerticleFactory.java:184) -> at io.reactiverse.es4x.impl.JSVerticleFactory.access$100(JSVerticleFactory.java:25) -> at io.reactiverse.es4x.impl.JSVerticleFactory$1.start(JSVerticleFactory.java:84) -> at io.vertx.core.impl.DeploymentManager.lambda$doDeploy$5(DeploymentManager.java:196) -> at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:264) -> at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:246) -> at io.vertx.core.impl.EventLoopContext.lambda$runOnContext$0(EventLoopContext.java:43) -> at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) -> at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) -> at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) -> at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:503) -> at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) -> at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) -> at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) -> at java.base/java.lang.Thread.run(Thread.java:829) -> Caused by: io.vertx.core.VertxException: URLs with multiple hosts are not supported yet ->

AbuzarHussain commented 2 years ago

Hi team, We're currently holding our next release because of this issue. As the milestone is set to vertx 4.3.5, can you please let me know when the vertx 4.3.5 would be released along with this fix? so that we can plan accordingly.

tsegismont commented 2 years ago

It's not planned yet, we've just released 4.3.4.

In the meantime, you can put your connection settings in a tnsnames file and use a tns alias in connection URI (see https://vertx.io/docs/vertx-oracle-client/java/#_connection_uri)