PGX 20.1.1
Documentation

Client Configuration Guide

PGX provides a couple of client configuration options:

What Can Be Configured?

Field Type Description Default
access_tokenstringthe authentication token (if server requires authentication)null
base_urlstringThe base url in the format host [ : port][ /path] of the PGX server REST end-point. If the base_url is null, the default will be used which points to embedded PGX instance.null
cctrace_outstring[relevant for enable_cctrace] when cctrace is enabled, specifies a path to a file where cctrace should log to. If null it will use the default PGX logger on level TRACE. If it is the special value :stderr: it will log to stderrnull
cctrace_print_stacktracesboolean[relevant for enable_cctrace] when cctrace is enabled, print the stacktrace for each request and resultfalse
client_server_interaction_modeenum[async_polling, blocking]if async_polling the PGX client would poll the status of the future until it's completed. If blocking the PGX client would send a request to directly get the value of the future and the server would block until the future result is readyasync_polling
enable_cctracebooleanif true log every call to a Control or Core interfacefalse
keystorestringpath to the keystore to use for client connections. The keystore is used to authenticate this client at the PGX server if two-way SSL/TLS is enabled.null
max_client_http_connectionsintegerMaximum number of connections to open to the PGX server2
passwordstringif username is given, this is the HTTP BASIC Auth password. If keystore is given, this is the keystore password.null
prefetch_sizeintegerHow many items should be prefetched in remote iterators.2048
remote_future_pending_retry_intervalintegerHow many milliseconds to wait before sending another request in case a GET request for a PgxRemoteFuture receives a 202 - Accepted response500
remote_future_timeoutintegerHow long one GET request for a PgxRemoteFuture will be alive, until it times out and tries again. Time in milliseconds, set it to zero for an infinite timeout. See HTTP Client SO_TIMEOUT for more details.300000
tls_versionstringTLS version to be used by the client. For example, TLSv1.2tlsv1.2
truststorestringpath to the truststore to use for client connections. The truststore is used to validate the server certificate if communicating over SSL/TLS.null
upload_batch_sizeintegerHow many items will be uploaded in a batch. This is used in Core#addAllToCollection() and Core#setProperty()65536
usernamestringThe username (if server requires HTTP BASIC authentication)null

How to Configure the Client

Note that client configuration options obviously do not have any effect when not in remote mode.

PGX Shell

All client configuration fields are available as command-line options:

$PGX_HOME/bin/pgx-jshell --base_url https://myhost:8080/pgx --username scott --prefetch_size 1024 --upload_batch_size 5000 --remote_future_timeout 20000 --pending_retry_interval 800

To see the full list, run

$PGX_HOME/bin/pgx-jshell --help

Java API

Use the corresponding Pgx.getInstance() methods when connection to a PGX instance:

public static ServerInstance getInstance(String baseUrl, String username, String password, Integer prefetchSize, 
      Integer uploadBatchSize, Integer remoteFutureTimeout, Integer remoteFuturePendingRetryInterval)

To specify key store and trust store for SSL connections use the standard JDK system properties:

System.setProperty("javax.net.ssl.trustStore", "<truststore>");
System.setProperty("javax.net.ssl.keyStore", "<keystore>");
System.setProperty("javax.net.ssl.keyStorePassword", "<password>");