Is the postgresql client supported for rxjava2?

148 views
Skip to first unread message

RCoe

unread,
Sep 29, 2018, 10:24:13 PM9/29/18
to vert.x
I was checking out the pgsql client documented here, https://vertx.io/docs/vertx-mysql-postgresql-client/java/, and I'm curious if this was written for rxjava1 or 2?  

JsonObject postgreSQLClientConfig = new JsonObject().put("host", "mypostgresqldb.mycompany");
SQLClient postgreSQLClient = PostgreSQLClient.createShared(vertx, postgreSQLClientConfig);

The example code doesn't include the import statements but the libraries I see for reactivex don't match the examples.  Can someone confirm whether the examples work as-is, but using io.vertx.ext.asyncsql.AsyncSQLClient to replace io.vertx.rxjava.ext.sql.SQLClient?  Or is it possible/preferable to follow the JDBCClient examples for hsqldb, used with the wiki database example?  If so, what are the set of properties that should be used for postgres, do they match the ones documented here, https://vertx.io/docs/vertx-mysql-postgresql-client/java/?

Other question concerns LTS of the postgres client library.  According to the documentation here, https://vertx.io/docs/vertx-mysql-postgresql-client/java/, the library is based on this project, https://github.com/mauricio/postgresql-async, which is no longer maintained.  The build is also broken.

So, is the existing documentation obsolete, since it is based on an unmaintained project, and is there a good reference for configuring postgres properties to create a reactivex JDBCClient, assuming the ones specified by the https://github.com/mauricio/postgresql-async project are not correct when creating a io.vertx.reactivex.ext.jdbc.JDBCClient?

Thanks.


Blake

unread,
Sep 30, 2018, 10:41:32 AM9/30/18
to vert.x
What postgres properties do you need exactly? The PostgresSQLClient is pretty similar to the JDBCClient. Check out the configuration docs. https://vertx.io/docs/vertx-jdbc-client/java/#_configuration vs https://vertx.io/docs/vertx-mysql-postgresql-client/java/#_configuration you'll notice not much difference. I know that some of the vert.x guys are working on a postgres async client: https://github.com/reactiverse/reactive-pg-client, but i haven't used it myself. The latter PG client has special considerations for postgres types (e.g., JSONB).

RCoe

unread,
Sep 30, 2018, 1:21:52 PM9/30/18
to vert.x
Sure, the properties are similar but the keys will be specific to the parser that sets up the connection pool.  So, I expect I would use the JDBCCLient property keys and substitute equivalent values for postgres.  Except, do I use the standard jdbc driver for postgres or can I still use the async pgsql client, which depends on the unmaintained project I mentioned?

Some of my confusion is related to the documentation, and I'm guessing the compatibility is with rxjava1 but also requires the use of the client libraries that are of questionable status.  I'll check out the project you linked, thanks for that.

This is the kind of discovery that makes attending the reactive conference worthwhile.  Just wish I could get the funds. :)

Thanks.

Blake

unread,
Sep 30, 2018, 3:24:22 PM9/30/18
to vert.x
I would abandon trying to use the unmaintained async project and use postgres's JDBC driver or use the newer one that I linked you -- which is maintained by vertx maintainers.

The standard JDBCClient should have rxified methods or you can use the RxHelper to wrap them if you want (I just use rxified and it's really nice). You can include 'io.vertx:vertx-rx-java2:3.5.3'to use the RxHelper and wrap the regular vertx behavior yourself. You just need to make sure that your imports use *.reactivex.* and not the *.rxjava.*.

Julien Viet

unread,
Oct 1, 2018, 7:38:33 AM10/1/18
to ve...@googlegroups.com
Hi,

have you checked the Reactive Postgres Client ?


Julien

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/f123d94b-841a-4136-8c88-c29dde92c533%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages