Running 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
        Note: The default JMX port for engines running inside docker is 5555. This port should be mapped with a local port, defined in the base Dockerfile, at run time using -p option.
      • 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 ...