PGX provides a couple of client configuration options:
Field | Type | Description | Default |
---|---|---|---|
access_token | string | the authentication token (if server requires authentication) | null |
base_url | string | The 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_out | string | [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 stderr | null |
cctrace_print_stacktraces | boolean | [relevant for enable_cctrace] when cctrace is enabled, print the stacktrace for each request and result | false |
client_server_interaction_mode | enum[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 ready | async_polling |
enable_cctrace | boolean | if true log every call to a Control or Core interface | false |
keystore | string | path 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_connections | integer | Maximum number of connections to open to the PGX server | 2 |
password | string | if username is given, this is the HTTP BASIC Auth password. If keystore is given, this is the keystore password. | null |
prefetch_size | integer | How many items should be prefetched in remote iterators. | 2048 |
realm_client_config | object | implementation dependent configuration options for the realm client | null |
remote_future_pending_retry_interval | integer | How many milliseconds to wait before sending another request in case a GET request for a PgxRemoteFuture receives a 202 - Accepted response | 500 |
remote_future_timeout | integer | How 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_version | string | TLS version to be used by the client. For example, TLSv1.2 | tlsv1.2 |
truststore | string | path 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_size | integer | How many items will be uploaded in a batch. This is used in Core#addAllToCollection() and Core#setProperty() | 65536 |
username | string | The username (if server requires HTTP BASIC authentication) | null |
Note that client configuration options obviously do not have any effect when not in remote mode.
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
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>");