Modifying the Container Configuration
You can configure additional container settings for:
Connecting to Services on the Host
If services (such as PubSub+ event broker) are exposed on the localhost, they can be referenced using the container platform’s special DNS name: host.docker.internal
for Docker and host.docker.internal
for Podman. Both of these names resolve to the outside host.
In the following examples, the container's special DNS name is mapped to SOLACE_JAVA_HOST
, which is the event broker host and port set in the application.yml
file. For more information, see Connecting to Your Event Broker
For example, in Docker, insert the following parameter in a run
command:
--env SOLACE_JAVA_HOST=host.docker.internal:55555 \
For example, in Podman, insert the following parameter in a run
command:
--env SOLACE_JAVA_HOST=host.containers.internal:55555 \
Configuring a Health Check
To configure a health check for the container, the container settings must:
-
Create a regular read-only user by setting the environment variables
SOLACE_CONNECTOR_SECURITY_USERS_0_NAME
andSOLACE_CONNECTOR_SECURITY_USERS_0_PASSWORD
. In the example below, the username and password are bothhealthcheck
.Setting the health check username and password in the container configuration overrides the health check settings in the
application.yml
file. -
Use the
healthcheck
user to poll the management health endpoint in the container’shealthcheck
command and fail it if the connector is unhealthy.
For example, in Docker, use the following parameters in a run
command:
--env SOLACE_CONNECTOR_SECURITY_USERS_0_NAME=healthcheck \ --env SOLACE_CONNECTOR_SECURITY_USERS_0_PASSWORD=healthcheck \ --healthcheck-command="curl -X GET -u healthcheck:healthcheck --fail localhost:8090/actuator/health" \
For example, in Podman, use the following parameters in a run
command:
--env SOLACE_CONNECTOR_SECURITY_USERS_0_NAME=healthcheck \ --env SOLACE_CONNECTOR_SECURITY_USERS_0_PASSWORD=healthcheck \ --healthcheck-command="curl -X GET -u healthcheck:healthcheck --fail localhost:8090/actuator/health" \
Configuring the JVM
You can set the JDK_JAVA_OPTIONS
environment variable on the container to configure the Java Virtual Machine (JVM). See the JDK documentation for more information.
Configuring Volumes
These are the supported directories for which volumes and bind mounts can be created:
Contents | Container Path | Required or Optional | Recommended Permission |
---|---|---|---|
Spring configuration files |
|
Required unless all properties are defined using environment variables. For more information, see the Spring documentation about environment variables. | Read-Only |
Libraries | /app/external/libs/
|
Required | Read-Only |
Classpath files | /app/external/classpath/
|
Optional | Read-Only |
Output files | /app/external/output/
|
Optional | Read/Write |
Volume: Spring Configuration Files
The Spring
configuration files volume is used to add Spring configuration files (such as application.yml
, etc.), add a read-only volume, or bind a mount to /app/external/spring/config/
.
This directory follows the same semantics as Spring’s default config/
directory. This fact means that this connector automatically finds and loads Spring configuration files from the following locations when the connector starts:
- The root of
/app/external/spring/config/
. - Immediate child directories of
/app/external/spring/config/
.
If you want configuration files for multiple, different connectors within the same config
directory for use in different environments (e.g., development, production, etc.), we recommend that you use Spring Boot Profiles instead of child directories.
For example, set up your configuration like this:
-
config/application-prod.yml
-
config/application-dev.yml
Do not set it up like this:
-
config/prod/application.yml
-
config/dev/application.yml
Child directories are intended to be used for merging configuration from multiple sources of configuration properties. For more information and an example of when you might want to use multiple child directories to compose your application’s configuration, see the Spring Boot documentation.
Volume: Libraries
The Libraries volume adds additional libraries, adds a read-only volume, or binds a mount to /app/external/libs/
.
This libs
directory is provided as the location for the Java library dependencies (external JAR files) that are either required or required only when using certain features of the connector (such as Prometheus libraries when using the metrics export to Prometheus feature in your connector configuration). Solace does not provide the required JAR files due to licensing considerations. These JAR files are required as part of the deployment of the connector for it to operate correctly.
See the documentation provided in the libs
directory of your download for more information.
Volume: Classpath Files
The Classpath Files volume adds a location for arbitrary files (neither JAR libraries nor Spring Boot configuration files), adds a read-only volume, or binds a mount to /app/external/classpath/
.
This directory must not contain JAR files for libraries or Spring Boot configuration files, otherwise there is a risk of libraries not getting picked up during the deployment of the connector and overwriting the connector’s internal configuration.
Volume: Output Files
The Output Files volume is for some features that support writing output files, such as logging to a file. To capture these, add a read/write volume or bind the mount to /app/external/output/
.
When using features that generate files, you must configure the features so that the files are generated to the /app/external/output/
directory. Generating files to any other directory is not supported.