Skip to content
OptaPlanner part of the Red Hat Summit 2019 Keynote Demo
JavaScript Java CSS HTML
Branch: master
Clone or download


Red Hat Summit OptaPlanner

Running Mechanical Scheduling demo only (optaplanner, infinispan, webgame server & dashboard UI)

  1. Clone cluster-setup repostiory:

    git clone
  2. Follow the deployment instructions in that repository

  3. Wait until the pods are running, then you can view the factory floor by accessing the Dashboard UI at Go to the admin UI at using the password that you set in step 4 with the variable ADMIN_PASSWORD and click on OptaPlanner to start simulation, unpauze dispatching and add/remove mechanics.

Build & run using Spring Boot

mvn spring-boot:run

To run with the Infinispan connector:

  1. Run infinispan server (make sure counters and DispatchEvents caches are added to the config file):

  2. Change hotrod endpoint in

  3. Run the application:

    `mvn spring-boot:run -Dprod`

Build & run on OpenShift

  1. Login to a running OpenShift instance

  2. Make sure datagrid service is running, if not deploy it:

    git clone
  3. Either use an existing project or create a new one by executing:

    oc new-project NAME
  4. Deploy the application to the project

    mvn clean package -Popenshift
  5. Find out a URL the service was exposed on

    oc get route

Infinispan relevant data

Below are examples on key/value pairs in Infinispan caches that are relevant to OptaPlanner.

Cache DispatchMechanic

    responseType: "DISPATCH_MECHANIC" or "ADD_MECHANIC",
    mechanic: {
        "mechanicIndex": 0,
        “originalMachineIndex”: 0,
        "focusMachineIndex": 0,
        "focusTravelDurationMillis": 1000,
        "focusFixDurationMillis": 2000
MECHANIC_ID-futureIndexes: {
    responseType: "UPDATE_FUTURE_VISITS",
    mechanicIndex: 0,
    futureMachineIndexes: [

Cache game

OptaPlannerConfig: {
    dispatchActive: true/false,
    simulationActive: true/false

Building an image and pushing it to a docker registry

First make sure docker daemon is running, if not type sudo systemctl start docker (or add the property

Create a .env file similar to .env.example containing your username and password and run the script


This command will build an image optaplanner-demo:latest and tag it temporarily as then push it to registry. Therefore, remove any images with the same tag before executing the command above.


Running the docker command without sudo should work, but doesn’t on a vanilla Fedora installation. If it doesn’t, try this:

dnf install docker
sudo groupadd docker
sudo usermod -aG docker `whoami`
sudo systemctl start docker
// If this fails with a permission problem, reboot first
docker run hello-world

If you’re getting 401 authorization issues during the mvn build, try this first:

docker login
docker login

If you follow security protocols and have different passwords for both services, run docker pull fabric8/java-centos-openjdk8-jdk:1.5 first with the credentials and then run the mvn command with the quay credentials.

You can’t perform that action at this time.