Setting Java options for source connectors
The Java options are passed to the source connectors by setting the JAVA_OPTS environment variable.
The JAVA_OPTS environment variable is set differently for connectors running as systemd services and for connectors running as non-systemd Docker instances.
Procedure for source connector running as systemd service
Create a systemd override file
The following command creates a systemd override file for the source connector aerospike-kafka-outbound.
sudo systemctl edit aerospike-kafka-outboundSet the JAVA_OPTS environment variable in the override file
In the override file that you created in the previous step, set the JAVA_OPTS environment variable in the Service section.
The following example sets a Netty workdir and Java maximum heap size using /connector/tmp as the workdir.
[Service]Environment=JAVA_OPTS="-Dio.netty.native.workdir=/connector/tmp -Xmx1024m"Reload the systemd manager configuration
Run the systemd command to reload the manager configuration:
sudo systemctl daemon-reloadRestart connector
Restart the systemd connector service for the aerospike-kafka-outbound source connector.
sudo systemctl restart aerospike-kafka-outboundProcedure for Docker (non-systemd)
In a non-systemd environment, explicitly set the JAVA_OPTS environment variable.
For Docker, add -e "JAVA_OPTS=LIST-OF-JAVA-OPTIONS" to the docker run command to set a Netty workdir and Java maximum heap size, though it could be any Java option.
docker run --name=example-connector -p 8080:8080 -e "JAVA_OPTS=-Dio.netty.native.workdir=/connector/tmp -Xmx8G" container.aerospike.com/aerospike/aerospike-kafka-outbound:5.3.11To verify that this was set correctly, run docker top example-connector.
You should see the source connector running with your Java options.