Closed ericsouza closed 3 years ago
@ericsouza Thanks I will take a look! Do you also use r2dbc with Quarkus?
@dstepanov Thanks!! Quarkus uses vertx-pg-client as the reactive postgres driver
You need to use a connection pool otherwise you are using a connection per request.
r2dbc:
datasources:
default:
options:
driver: pool
protocol:
postgres
url: r2dbc:postgres://localhost:5432/micronaut
username: micronaut
password: micronaut
schema-generate: CREATE_DROP
dialect: postgres
and add the pool dependency:
<dependency>
<groupId>io.r2dbc</groupId>
<artifactId>r2dbc-pool</artifactId>
<scope>runtime</scope>
</dependency>
This runs without errors for me.
@dstepanov how can I configure pool properties here?
https://github.com/r2dbc/r2dbc-pool I think the properties are listed. Correct me if I am wrong.
Put them in under options
like driver
Task List
Steps to Reproduce
Follow the steps below (the code is based on the doc-examples/r2dbc-example-java but without the use of RxJava)
Download the project example at: https://github.com/ericsouza/micronaut-rest
Start a Postgres Database:
Run the project
Insert some fruits to database
See the error:
Run basic load test:
See the error:
13:51:10.625 [reactor-tcp-epoll-6] WARN i.r.p.client.ReactorNettyClient - Error: SEVERITY_LOCALIZED=FATAL, SEVERITY_NON_LOCALIZED=FATAL, CODE=53300, MESSAGE=sorry, too many clients already, FILE=proc.c, LINE=346, ROUTINE=InitProcess
Info
I'm evaluating the use of a new Java framework with fully reactive functionality. I'm basically choosing between Quarkus or Micronaut. In Quarkus I was able to run the load test above withou any problem, but some things in micronaut are really awesome to have.
Expected Behaviour
Run without errors and be able to handle the load test
Actual Behaviour
Receiveing Warning when inserting a fruit object to the dabase and also getting a lot of errors when using many connections.
Environment Information
Example Application
Am I doing something wrong? I almost sure that I am missing something