You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vertx-pg-client/src/main/asciidoc/index.adoc
+23-2Lines changed: 23 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,7 @@ The client is reactive and non-blocking, allowing to handle many database connec
20
20
* SSL/TLS
21
21
* Unix domain socket
22
22
* HTTP/1.x CONNECT, SOCKS4a or SOCKS5 proxy support
23
+
* Proxy (level 4 and 7) support
23
24
24
25
== Usage
25
26
@@ -564,12 +565,32 @@ All https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-PROTECTION[
564
565
565
566
More information can be found in the http://vertx.io/docs/vertx-core/java/#ssl[Vert.x documentation].
566
567
567
-
== Using a proxy
568
+
== Using a level 4 proxy
568
569
569
-
You can also configure the client to use an HTTP/1.x CONNECT, SOCKS4a or SOCKS5 proxy.
570
+
You can configure the client to use an HTTP/1.x CONNECT, SOCKS4a or SOCKS5 level 4 proxy.
570
571
571
572
More information can be found in the http://vertx.io/docs/vertx-core/java/#_using_a_proxy_for_client_connections[Vert.x documentation].
572
573
574
+
== Using a level 7 proxy
575
+
576
+
Level 7 proxies can load balance queries on several connections to the actual database. When it happens, the client can be confused by the lack of session affinity and unwanted errors can happen like _ERROR: unnamed prepared statement does not exist (26000)_.
577
+
578
+
Supported proxies:
579
+
580
+
- https://www.pgbouncer.org[PgBouncer] configured with `_pool_mode=transaction`.
581
+
582
+
You can configure the client to interact differently to the proxy:
583
+
584
+
[source,$lang]
585
+
----
586
+
{@link examples.PgClientExamples#pgBouncer}
587
+
----
588
+
589
+
When doing so, prepared statement cannot be cached and therefore
590
+
591
+
- prepared statement caching must be disabled
592
+
- explicit prepared statement can only live within the scope of a transaction, it means you can use cursors but the prepared statement for the cursor must be created and destroyed within the scope of a transaction
0 commit comments