---
title: "Set Java options for outbound connectors"
description: "Configure JAVA_OPTS for Aerospike outbound connectors in systemd and Docker environments."
---

# Set Java options for outbound connectors

> For the complete documentation index see: [llms.txt](https://aerospike.com/docs/llms.txt)
> 
> All documentation pages available in markdown.

## 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
    
    ```bash
    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
    
    ```bash
    [Service]
    
    Environment=JAVA_OPTS="-Dcom.aerospike.shaded.io.netty.native.workdir=/tmp/connector -Xmx1024m"
    ```
    
3.  Run the `systemd` command to reload the manager configuration:
    
    Terminal window
    
    ```bash
    sudo systemctl daemon-reload
    ```
    
4.  Restart the `systemd` connector service.
    
    Terminal window
    
    ```bash
    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

```shell
docker run  --name=example-connector -p 8080:8080 -e "JAVA_OPTS=-Dcom.aerospike.shaded.io.netty.native.workdir=/connector/tmp -Xmx8G" container.aerospike.com/aerospike/aerospike-esp-outbound:latest
```

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.