Set environment variables
Mandatory environment variables
The Batch Acquirer expects some configuration variables to be always explicitly set. The following table explains those variables in detail.
Variable
Description
Possible values
ACQ_BATCH_SCHEDULED
Set the scheduled execution through the internal scheduler
true, false
ACQ_BATCH_INPUT_CRON
Defines when to execute the batch if ACQ_BATCH_SCHEDULED valued at 'true'
CronSequenceGenerator (Spring Framework 5.3.13 API) i.e.: "0 0 * * * *" runs every hour
ACQ_BATCH_TRX_INPUT_PATH
The path to the directory containing the transaction files to be processed as input
Path on file system
ACQ_BATCH_TRX_LOGS_PATH
The directory path where any filtered or failed records will be saved
Path on file system
ACQ_BATCH_OUTPUT_PATH
The path where the output files will be deposited
Path on file system
ACQ_BATCH_HPAN_INPUT_PATH
Path where the HPAN file is saved after download
Path on file system
ACQ_BATCH_SENDER_ADEACK_OUTPUT_PATH
Path where the ade ack files are saved after download
Path on file system
HPAN_SERVICE_API_KEY
API key for authorization (see Appendix 2 - Acquirer Services Authorization)
String
HPAN_SERVICE_KEY_STORE_FILE
Path to the key store (.jks) containing the private key for mTLS authentication
Path on file system
HPAN_SERVICE_KEY_STORE_PASSWORD
Key store password (.jks) containing the private key for mTLS authentication
String
HPAN_SERVICE_TRUST_STORE_FILE
Path to the key store (.jks) containing the certificate for mTLS authentication
Path on file system
HPAN_SERVICE_TRUST_STORE_PASSWORD
Key store password (.jks) containing the certificate for mTLS authentication
String
JAVA_TOOL_OPTIONS
Extra parameters for the Java Virtual Machine. It is required to set at least 6GB of Heap through the parameters "-Xms6g -Xmx6g"
String
An easy way to set up the environment is to adopt a dedicated shell script with a content like the following:
export ACQ_BATCH_SCHEDULED=true
export ACQ_BATCH_INPUT_CRON="0 0 * * * *"
export ACQ_BATCH_TRX_INPUT_PATH=/workdir/input
export ACQ_BATCH_HPAN_INPUT_PATH=/workdir/hpans
export ACQ_BATCH_TRX_LOGS_PATH=/workdir/logs
export ACQ_BATCH_OUTPUT_PATH=/workdir/output
export ACQ_BATCH_SENDER_ADEACK_OUTPUT_PATH=/workdir/ade-errors
export HPAN_SERVICE_URL=https://api.cstar.pagopa.it
export HPAN_SERVICE_API_KEY=<YOUR_API_KEY_HERE>
export HPAN_SERVICE_KEY_STORE_FILE=<PATH_TO_JKS>
export HPAN_SERVICE_KEY_STORE_PASSWORD=<JKS_PASSWORD>
export HPAN_SERVICE_TRUST_STORE_FILE=<PATH_TO_JKS>
export HPAN_SERVICE_TRUST_STORE_PASSWORD=<JKS_PASSWORD>
export JAVA_TOOL_OPTIONS="-Xms6g -Xmx6g"
Assuming you've saved the script with the name setenv.sh you could export all variables at once in the current environment by executing the command:
source ./setenv.sh
Relevant environment variables presets
The following are the relevant presets that allow to get the Batch Service ready for a specific step/task.
Make sure to set the proper environment entities (API key, JKSs and passwords) every time you change environment variables file.
Relevant optional environment variables
Those are the most relevant non-mandatory variables. For a exhaustive list of all variables see the repository README file.
Variable
Description
Possible values
Default
HPAN_SERVICE_PROXY_ENABLED
If set to 'true' HTTP requests are routed to the configured proxy service
true, false
false
HPAN_SERVICE_PROXY_HOST
Hostname of the proxy service (use in conjunction to HPAN_SERVICE_PROXY_ENABLED set to 'true')
hostname
n/a
HPAN_SERVICE_PROXY_PORT
Port number of the proxy service (use in conjunction to HPAN_SERVICE_PROXY_ENABLED set to 'true')
TCP port number
n/a
HPAN_SERVICE_PROXY_USERNAME
Username for proxy authentication (use in conjunction to HPAN_SERVICE_PROXY_ENABLED set to 'true')
username
n/a
HPAN_SERVICE_PROXY_PASSWORD
Password for proxy authentication (use in conjunction to HPAN_SERVICE_PROXY_ENABLED set to 'true')
password
n/a
ACQ_BATCH_INITIALIZE_SCHEMA
Set automatic initialisation of the database schema
always, never
always
ACQ_BATCH_INPUT_PART_MAX_POOL_SIZE
5
ACQ_BATCH_INPUT_PART_CORE_POOL_SIZE
5
ACQ_BATCH_INPUT_PART_READ_MAX_POOL_SIZE
5
ACQ_BATCH_INPUT_PART_READ_CORE_POOL_SIZE
5
Last updated