Running TIBCO BusinessEvents® Application in Docker
By using the BusinessEvents application Docker image, you can run the BusinessEvents application in Docker.
Prerequisites
- Install Docker on the machine and perform the initial setup based on your operating system. Refer to the Docker documentation at https://docs.docker.com for complete details on Docker installation.
- Ensure that a network bridge exists for internal communication between Docker images. You can use the
network create command of Docker to create the network bridge:
docker network create <BRIDGE_NAME>
- Build the BusinessEvents application Docker image, see Building BusinessEvents Application Docker Image.
Procedure
-
Execute the
run command and provide value for the following options to run the BusinessEvents application.
docker run --net=<BRIDGE_NETWORK> --name=<CONTAINER_NAME> -e PU=<PU_NAME> -e <ADDITIONAL_ENV_VARS> <APPLICATION_IMAGE_NAME>
Where:- --net=<BRIDGE_NETWORK> - Specify the name of the network bridge that you have created. This connects the container to the specified network.
- --name=<CONTAINER_NAME> - Specify a name that you want to assign to the container.
- <APPLICATION_IMAGE_NAME> - Specify the name of the BusinessEvents application Docker image.
- -e
<PU_NAME> <ADDITIONAL_ENV_VARS> - Use the
-e option to set environment variables, as required, with syntax
VAR=Value. You can use the following environmental variables that at the run time.
- AS_DISCOVER_URL: Specify the discover URL, which enables members to discover each other in the datagrid. For example:
docker run --net=simple-bridge --name=inference -e AS_DISCOVER_URL=tcp://cache:50000 -e PU=default -p 8109:8109 fdcache:v01
Here the docker name of the cache server "cache" is used for the AS_DISCOVER_URL of the inference agent. Since all agents running on the same Docker host can resolve Docker names to their IP addresses on the network, thus you can create clusters across instances on the same Docker. - COMPONENT: This environment variable is required for rule management server. Specify this environment variable value as rms to run the rule management server. See Running BusinessEvents Rule Management Server (RMS) in Docker for more details.
- PU: Specify the processing unit that need to be started. For example, running the application with "cache" as processing unit:
docker run --net=be_netowrk --name=cache -e PU=cache fdcache:v01
-
LOG_LEVEL: Specify the override value for the predefined log level. You can specify the comma separated values for the log patterns required. If the
LOG_LEVEL environment variable is not specified, the
log-config of the CDD file is used. The pattern configurations are same as the the
log-config of the CDD file. For example:
docker run --net=simple-bridge --name=cache -e PU=cache –e LOG_LEVEL=*:debug fdcache:v01
-
DOCKER_HOST: Specify the host, where the
docker run command is executed. This environment variable is required for remote JMX connections to the running container. For example:
docker run --net=be_network --name=sample –p 5555:5555 -e PU=default –e DOCKER_HOST=10.97.123.56 sample:v01
- AS_PROXY_NODE: Specifies whether the container run as a proxy node. Set the value to
true, to start the node in proxy mode. For example:
docker run ... –e AS_PROXY_NODE=true ...
The port 50001 is the default ActiveSpaces remote listen port which can be specified while connecting to the proxy node. For example:docker run ... -e AS_DISCOVER_URL=tcp://<container_name>:50001?remote=true ...
-
TRA properties: You can specify any of the BusinessEvents engine and JVM properties as an environment variable.
To use the property, append tra. at the beginning of the property name. For example, to use java.extended.properties, provide tra.java.extended.properties and its value as environment variable. The value of the environment variable tra.java.extended.properties overwrites the value of the java.extended.properties property in the be-engine.tra file.
You can also specify few JVM properties, such as, -Xms, -Xmx, and -Xss as environment variable individually. These individual JVM properties, when specified as environment variable, take precedence over the JVM properties defined in the tra.java.extended.properties environment variable. Other JVM properties, such as, garbage collection properties still have to be defined under the tra.java.extended.properties environment variable. The following table lists the environment variables that you can use for these JVM property options.
For example:docker run -e "tra.java.heap.size.initial=1024m" -e "tra.java.heap.size.max=1024m" -e "tra.java.stack.size=2m" -e="tra.java.extended.properties=-server -Xms512m -Xmx512m -javaagent:%BE_HOME%/lib/cep-base.jar -XX:MaxMetaspaceSize=256m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC" com.tibco.be.fd:v016
In the previous example, tra.java.heap.size.initial=1024m and tra.java.heap.size.max=1024m takes precedence over the -Xms512m and -Xmx512m options of tra.java.extended.properties. Thus, the initial Java heap size and maximum Java heap size is set to 1024M instead of 512M. Also, the tra.java.stack.size=2m environment variable sets the -Xss option of java.extended.properties property in the be-engine.tra file to 2M. -
Global Variable: You can specify a global variable as an environment variable to override its value. Provide the global variable name and its value as an environment variable. For example, to specify value for the global variable
HOSTNAME as
localhost, run the following command:
docker run ... –e "HOSTNAME=localhost" ...
- AS_DISCOVER_URL: Specify the discover URL, which enables members to discover each other in the datagrid. For example: