Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Oct 14 20:22
    jbellassai commented #454
  • Oct 14 15:55
    jbellassai opened #454
  • Oct 13 10:02
    mp911de commented #453
  • Oct 13 10:02
    mp911de labeled #453
  • Oct 13 10:02
    mp911de unlabeled #453
  • Oct 13 07:28
    florianrusch opened #453
  • Oct 13 07:28
    florianrusch labeled #453
  • Oct 12 14:13
    mp911de commented #429
  • Oct 12 14:06
    jbellassai commented #429
  • Oct 07 15:51
    rotty3000 commented #247
  • Oct 07 15:37
    ascertrobw commented #247
  • Oct 07 15:21
    mp911de commented #247
  • Oct 07 15:20
    rotty3000 commented #247
  • Oct 07 15:17
    rotty3000 commented #247
  • Oct 07 15:15
    rotty3000 synchronize #247
  • Oct 07 06:47
    mp911de closed #452
  • Oct 07 06:47
    mp911de commented #452
  • Oct 07 06:47
    mp911de unlabeled #452
  • Oct 07 06:47
    mp911de labeled #452
  • Oct 07 02:08
    kaladhar-mummadi labeled #452
EugeneZakhno
@EugeneZakhno
below my controller:
   @GetMapping("/findbyphonenumber/{phoneNumber}")
    Mono<Boolean> existsPhoneNumber(@PathVariable String phoneNumber){
        return usersRepository.existsPhoneNumber(phoneNumber);
    }
1 reply
Help me, please. Say reason
EugeneZakhno
@EugeneZakhno
Maybe it works just for id because it's type Long? It's bad. We need more methods for finding from database
Dan Cohen-Smith
@dancohensmith
any known issues with the connection pool ? service is fine in normal running but if we put it under heavy load ( approx 20-25tps) we start to gt failed to acquire connection is 2000ms. we have turned on eviction and max-idle using remote depth to validate the connection. any ideas?
Umesh Karan
@umeshonlyumesh:matrix.org
[m]
Hi Guys ..I am facing problem while connecting oracle using r2dbc
this publisher does not support multiple subscribers
any idea ? how to fix this issue ? I am connecting to the remote oracle server
Mark Paluch
@mp911de
Umesh Karan
@umeshonlyumesh:matrix.org
[m]
thanks :)
Umesh Karan
@umeshonlyumesh:matrix.org
[m]
after taking the latest r2dbc driver ....that multiple subscriber issue gone but facing another issue
Failed to obtain R2DBC Connection; nested exception is io.r2dbc.spi.R2dbcTransientResourceException: [12514] [08006] Listener refused the connection with the following error: ORA-12514, TNS:listener does not currently know of service requested in connect descriptor (CONNECTION_ID=T8/zWBdvTgWge+ezncbOUg==)
org.springframework.dao.DataAccessResourceFailureException: Failed to obtain R2DBC Connection; nested exception is io.r2dbc.spi.R2dbcTransientResourceException: [12514] [08006] Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
(CONNECTIONID=T8/zWBdvTgWge+ezncbOUg==)
at org.springframework.r2dbc.connection.ConnectionFactoryUtils.lambda$getConnection$0(ConnectionFactoryUtils.java:88)
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
|
checkpoint ⇢ Handler com.example.demo.StudentController#getAllTaskStateEnum() [DispatcherHandler]
| checkpoint ⇢ org.springframework.boot.actuate.metrics.web.reactive.server.MetricsWebFilter [DefaultWebFilterChain]
|
checkpoint ⇢ HTTP GET "/students/getAllTaskStateEnum" [ExceptionHandlingWebHandler]
Umesh Karan
@umeshonlyumesh:matrix.org
[m]
I think the problem sid v/s service name
can some help ? how to pass sid in connection url ?
Umesh Karan
@umeshonlyumesh:matrix.org
[m]
i have changed my connection url to use sid not service name and it worked
thanks
Alan Moffet
@amoffet
I have a question about the maven group id for the r2dbc postgresql driver. The readme in github shows that the group id is org.postgresql and the artifact id is r2dbc-postgresql. The latest release for this is 0.9.0.M1 - dated February 2021. However, io.r2dbc is also a group id in maven - the latest release being 0.8.8.RELEASE (May 2021). I'm curious about the track. It appears that I should anticipate 0.9.0.M2 for org.postgresql and that io.r2dbc is deprecated - but was released after the movement to org.postgresql for compatibility's sake? Or is there something else I should be aware of?
Umesh Karan
@umeshonlyumesh:matrix.org
[m]
can some help me here
no error but not showing the output
postman request is spinning
Robert Heim
@RobertHeim
Hi any idea why Json.of(myString) is not able to convert umlauts properly when run in a docker container (build with ./gradlew bootBuildImage) ? From the IDE it works fine.
Robert Heim
@RobertHeim
Turns out setting the env var JAVA_OPTS to -Dfile.encoding=UTF8 fixes it
kitkars
@kitkars
Hi Guys,
I would like to convert a field (column which is int type) to an Enum ?
We do not have the support for @Enumerated in r2dbc. is there any other option?
kitkars
@kitkars
Robert Heim
@RobertHeim
Does anyone know why the port is added twice when using SPRING_R2DBC_URL: r2dbc:postgresql://db_app:5432/app? It results in "cannot connect to db_app:5432:5432" help would be very appreciated! I posted more details here https://stackoverflow.com/questions/68571926/r2dbc-connection-port-added-twice-cannot-connect-to-db-app54325432-while-jdb
StalkerSun
@StalkerSun
Hello everyone! Can you please tell me how you can redefine the execution context for r2dbc to fill requests on boundElastic?
Shashank
@shankyty
Hello everyone,
I am looking for creating a sever which can be connected using jdbc and behave like mysql or postgres server.
Reason to do so is the client is not my code, and that platform will running production env. All I can do is can configure a mysql or postgres servers to pull data.
I have a code which generates data on fly. I want to stream that data to this platform.
aditya parikh
@adityaparikh_twitter
@RobertHeim I also saw that. Seems like a bug. It kept adding the 5432 default port even if I specified another port.
Anton Duyun
@Squiry
Can you reproduce it without spring?
Alexei Gorbachenko
@agorbachenko
Hi there! I have noticed that after r2dbc repository call my reactive chain was switching to be executed on netty event loop threads (reactor-tcp-<TRANSPORT>-N). This affects overall application's performance. Is this expected behavior? If so, I think it should be fixed in my code by switching to different scheduler (using .publishOn(...)) after every r2dbc query. Am I right?
Mark Paluch
@mp911de
Thread switching happens arbitrarily by default and threads shouldn't become a concern unless you run CPU-heavy workloads (e.g. JSON de-/serialization, crypto).
Typically, you have as many I/O threads as CPU cores. Depending on your usage scheme (one/many connections), you might observe different performance profiles.
Alexei Gorbachenko
@agorbachenko

I actually have reactive chain like:

  • incoming http query (webflux)
  • several db queries one by one (r2dbc)
  • outgoing http query (webclient)
  • several db queries one by one (r2dbc)
  • respond with result

I have several thousands rps. Application is fully reactive (no blocking). Most reactive steps are performed on reactor-tcp-epoll threads and I was observing a lot of db connections (200-300) in pending state at that time. Latency of the whole chain is about 200ms.

But if I change scheduler with .publishOn() after every r2dbc call, latency is 50ms and no pending db connections in pool.

Alexei Gorbachenko
@agorbachenko

I have some update on the problem. I tried to increase load in 1.5 times and noticed increased latency from 50 ms to 300 ms (while CPU utilization was far from 100%) for 5 app instances 4 CPU per instance. BUT changing deployment configuration to 10 instances 2 CPU per instance helps to reduce latency to 50 ms. So the total amount of system resources is the same but latency is affected.

Additionally I discovered that only 1 netty thread is busy - reactor-tcp-epoll-1. Thread-dump of other netty threads is:
java.lang.Thread.State: RUNNABLE
at app//io.netty.channel.epoll.Native.epollWait(Native Method)
....

This can explain why 10x2CPU performes better than 5x4CPU (total size of db connections is the same).

My question is it possible to tune r2dbc or netty to use more netty threads? Thanks in advance.

Mark Paluch
@mp911de
A I/O thread is bound to a connection. Connections cannot make use of multiple threads. The only way to run workload across multiple threads (without using publishOn) is to use multiple connections.
Mark Paluch
@mp911de
@agorbachenko sorry, it seems I accidentally deleted your message here while wanting to copy a permalink. Can you file your finding as ticket in https://github.com/reactor/reactor-netty/issues?
Alexei Gorbachenko
@agorbachenko

ok, I'll create ticket.

I also have restored my previous message:

I digged into the problem and found something strange in reactor-netty. While debugging how PostgresqlConnection's channel (->ReactorNettyClient->reactor.netty.Connection->io.netty.Channel) is binded to eventLoop from eventLoopGroup I found that first channel was binded to reactor-tcp-nio-1 (1) but next channels were binded to localLoop which is actually reactor-tcp-nio-1 (2).

reactor.netty.resources.ColocatedEventLoopGroup:
@Override
public EventLoop next() {
if (localLoop.isSet()) {
return localLoop.get(); // (2)
}
return eventLoopGroup.next(); // (1)
}

For test purposes I tried to override class reactor.netty.resources.DefaultLoopResources in my application's classpath with the same class but without wrapping into ColocatedEventLoopGroup.

DefaultLoopResources#cacheNativeClientLoops:
EventLoopGroup cacheNativeClientLoops() {
EventLoopGroup eventLoopGroup = cacheNativeClientLoops.get();
if (null == eventLoopGroup) {
EventLoopGroup newEventLoopGroup = cacheNativeServerLoops(); // LoopResources.colocate(cacheNativeServerLoops());
if (!cacheNativeClientLoops.compareAndSet(null, newEventLoopGroup)) {
// Do not shutdown newEventLoopGroup as this will shutdown the server loops
}
eventLoopGroup = cacheNativeClientLoops();
}
return eventLoopGroup;
}

With this fix all netty reactor-tcp-epoll threads were utilized and performance significantly increased.

Alexei Gorbachenko
@agorbachenko

@mp911de I asked how to change ColocatedEventLoopGroup's behavior in https://gitter.im/reactor/reactor-netty?at=6145cdac99b7d9752817ad74

It looks the only option is to use https://projectreactor.io/docs/netty/release/api/reactor/netty/transport/Transport.html#runOn-reactor.netty.resources.LoopResources- which requires to implement LoopResources and this is a problem because many classes from reactor.netty.resources are not public.

Finally, I found a workaround for the problem by creating delegating connection factory that creates connection on specified scheduler, so ColocatedEventLoopGroup's logic on next() that returning the localLoop is not working:

        return new DelegatingConnectionFactory(originalConnectionFactory) {
            @Override
            public Mono<? extends Connection> create() {
                return super.create().publishOn(Schedulers.single());
            }
        };
Nathan Sevugan
@nathansevugan

I am running into a peculiar problem with springboot/r2dbc-pool/postgres. When the connection is silently closed either by the DB or by the firewall, the pool does not validate the connection before it is handed over to the consumer. Usually, overnight, when our services are idle these connections are severed and the first application database activity fails with an
Exception:
"DataAccessResourceFailureException: Failed to obtain R2DBC Connection; nested exception. "

We have tried the following configuration,
max-idle-time: 15s
max-create-connection-time: 10s
max-acquire-time: 5s
max-life-time: 20s

We also tried some postgres driver configurations. Nothing seems to fix the problem. Any thoughts on this topic will be appreciated.

Mahdi Amini
@bmd007
Hi .. How can I use spring r2dbc and connecting to a google cloud database which is not protected by password? It's protected by checking service accounts so there is no password.
if I do spring.cloud.gcp.sql.enable-iam-auth=true jdbc works well without password
Mark Paluch
@mp911de
Paging @elefeint
Elena Felder
@elefeint
@bmd007 You'll need to use https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory -- it has integrations for R2DBC as well
Elena Felder
@elefeint
You could also upvote GoogleCloudPlatform/spring-cloud-gcp#205 for us to prioritize it. It's a bit of an awkward place to provide this configuration, since R2DBC is not part of Spring, but it seems to be a useful convenience.
Mahdi Amini
@bmd007
thankss
Ben Tomasini
@btomasini
Hello, I am using r2dbc with micronaut data / jpa and postgresql. I am getting this error:
Binding parameters is not supported for the statement 'SELECT location_."id",location_."name",location_."address",location_."city",location_."state",location_."zip",location_."phone",location_."website",location_."gender_specific",location_."latitude",location_."longitude" FROM "location" location_ WHERE (location_."id" = ?)'
1 reply
amit handa
@amit-handa

hello everyone, I am getting following error when connecting to db via r2dbc. using latest versions of the components r2dbc-pool, r2dbc-postgres etc. can somebody help me resolve/debug it ? thanks

org.springframework.dao.DataAccessResourceFailureException: Failed to obtain R2DBC Connection; nested exception is java.util.concurrent.TimeoutException: Did not observe any item or terminal signal within 10000ms in 'Connection Allocation' (and no fallback has been configured)

// R2DBC implementation "io.r2dbc:r2dbc-postgresql:0.8.10.RELEASE" implementation "io.r2dbc:r2dbc-pool:0.8.7.RELEASE" implementation "io.r2dbc:r2dbc-proxy:0.8.8.RELEASE" implementation "org.springframework:spring-r2dbc:5.3.10" implementation "org.springframework.data:spring-data-r2dbc:1.3.5" implementation "org.springframework.data:spring-data-commons:2.5.5"

2 replies
Dan Cohen-Smith
@dancohensmith
hi any examples of using transactions with the SPI?
trying to use r2dbc with Jooq with transactions