PostgresqlConnectionFactory host not resolved on linux

Visto 35 veces
Saltar al primer mensaje no leído

Stefan Schöning

no leída,
6 jul 2023, 7:26:106/7/23
a r2dbc
Hi all,

i have a strange behavior  with my example code ich have no problems to connect to my DB in mac os 64bit/amd and 64bit/arm 
when i use native-packager to deploy to kubernetes i got a host/<unresolved> error and i cannot conncet to db

So i wrote a little codeexample and run ist on a nativ linux 64bit machine and got the same error there!

Cannot connect to myhostlocation.../<unresolved>:5433

val config = PostgresqlConnectionConfiguration
.builder()
.host("myhostlocation...")
.port(5433)
.database("yugabyte")
.username("someuser")
.password("mysecretpassword")
.build()


val connection = connectionFactory.create()

val mono: Mono[Connection] = Flux.from(connection).next()

mono.flatMapMany(connection => {
println("Connection established")
connection.createStatement("INSERT INTO person (id, first_name, last_name) VALUES ($1, $2, $3)")
.bind("$1", 1)
.bind("$2", "Walter")
.bind("$3", "White")
.execute()
}).flatMap(result => {
println("Statement executed")
result.getRowsUpdated
}).subscribe(rowsUpdated => {
println("Inserted " + rowsUpdated + " row(s)")

})

Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos