Skip to content

Set Java options for outbound connectors

Overview

Java options are passed to the 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.

Set Java options for a connector running as a systemd service

  1. Create a systemd override file with the following command:

    Terminal window
    sudo systemctl edit CONNECTOR_NAME

    Replace the CONNECTOR_NAME placeholder with the name of the connector for which you want to create an override file. Possible values are aerospike-jms-inbound, aerospike-jms-outbound, aerospike-kafka-outbound, aerospike-pulsar-outbound, aerospike-pubsub-outbound, aerospike-xdr-proxy.

  2. Edit the override file to set the JAVA_OPTS environment variable in the Service section. This example sets a netty workdir and Java maximum heap size:

    Terminal window
    [Service]
    Environment=JAVA_OPTS="-Dio.netty.native.workdir=/connector/tmp -Xmx1024m"
  3. Run the systemd command to reload the manager configuration:

    Terminal window
    sudo systemctl daemon-reload
  4. Restart the systemd connector service.

    Terminal window
    sudo systemctl restart <connector-name>

Set Java options for Docker (non systemd)

In a non-systemd environment, you must explicitly set the JAVA_OPTS environment variable.

For Docker, add -e "JAVA_OPTS=<list of java options>" to the exec. All connectors use the same method. For example, in ESP, the Docker command might be:

Terminal window
docker run --name=example-connector -p 8080:8080 -e "JAVA_OPTS=-Dio.netty.native.workdir=/connector/tmp -Xmx8G" container.aerospike.com/aerospike/aerospike-esp-outbound:2.4.10

Like the examples in the previous section, this sets a Netty workdir and Java maximum heap size, but it could be any Java option.

To verify that this was set correctly, run docker top example-connector. You should see the connector running with your Java options.

Feedback

Was this page helpful?

What type of feedback are you giving?

What would you like us to know?

+Capture screenshot

Can we reach out to you?