10.3. Realtime Decision Server Setup

10.3.1. Bootstrap Switches

The Realtime Decision Server accepts a number of bootstrap switches (system properties) to configure the behavior of the server. The following is a table of all the supported switches:

Note

Some properties are marked as required when using a controller, so you need to set these properties when you handle Realtime Decision Server container creation and removal in Business Central. If you use the Realtime Decision Server separately—​without any interaction with Business Central—​you do not have to set these properties.

Realtime Decision Server Bootstrap Switches

kie.maven.settings.custom

The location of a custom settings.xml file for Maven configuration.

ValuesDefault

Path

N/A

kie.server.jms.queues.response

The JNDI name of response queue for JMS.

ValuesDefault

String

queue/KIE.SERVER.RESPONSE

org.drools.server.ext.disabled

When set to true, disables the BRM support (for example rules support).

ValuesDefault

true or false

false

org.drools.server.filter.classes

When set to true, the Drools Realtime Decision Server extension accepts custom classes annotated by XmlRootElement or Remotable annotations only.

ValuesDefault

true or false

false

org.kie.executor.disabled

Disables the Red Hat JBoss BRMS executor.

ValuesDefault

true or false

false

org.kie.executor.interval

The time between the moment the Red Hat JBoss BRMS executor finishes a job and the moment it starts a new one, in a time unit specified in org.kie.executor.timeunit.

ValuesDefault

Number (Integer)

3

org.kie.executor.pool.size

The number of threads used by the Red Hat JBoss BRMS executor.

ValuesDefault

Number (Integer)

1

org.kie.executor.retry.count

The number of retries the Red Hat JBoss BRMS executor attempts on a failed job.

ValuesDefault

Number (Integer)

3

org.kie.executor.timeunit

The time unit in which the org.kie.executor.interval is specified.

ValuesDefault

A java.util.concurrent.TimeUnit constant

SECONDS

org.kie.server.controller

A comma-separated list of URLs to controller REST endpoints, for example http://localhost:8080/business-central/rest/controller. This property is required when using a controller.

ValuesDefault

Comma-separated list

N/A

org.kie.server.controller.connect

The waiting time between repeated attempts to connect Realtime Decision Server to the controller when Realtime Decision Server starts up, in milliseconds.

ValuesDefault

Number (Long)

10000

org.kie.server.controller.pwd

The password to connect to the controller REST API. This property is required when using a controller.

ValuesDefault

String

kieserver1!

org.kie.server.controller.token

This property allows you to use a token-based authentication between the KIE server and the controller instead of the basic user name/password authentication. The KIE server sends the token as a parameter in the request header. Note that long-lived access tokens are required as the tokens are not refreshed.

ValuesDefault

String

N/A

org.kie.server.controller.user

The user name to connect to the controller REST API. This property is required when using a controller.

ValuesDefault

String

kieserver

org.kie.server.domain

The JAAS LoginContext domain used to authenticate users when using JMS.

ValuesDefault

String

N/A

org.kie.server.id

An arbitrary ID to be assigned to this server. If a remote controller is configured, this is the ID under which the server will connect to the controller to fetch the KIE container configurations. If not provided, the ID is automatically generated.

ValuesDefault

String

N/A

org.kie.server.location

The URL of the Realtime Decision Server instance used by the controller to call back on this server, for example: http://localhost:8230/kie-server/services/rest/server. This property is required when using a controller.

ValuesDefault

URL

N/A

org.kie.server.pwd

The password used to connect with the KIE server from the controller, required when running in managed mode. You must set this property in Business Central system properties, and it is required when using a controller.

ValuesDefault

String

kieserver1!

org.kie.server.repo

The location where Realtime Decision Server state files will be stored.

ValuesDefault

Path

.

org.kie.server.sync.deploy

Instructs the KIE server to hold the deployment until the controller provides the containers deployment configuration. This property affects only the KIE servers running in managed mode. The options are as follows:

  • false; the connection to the controller is asynchronous. The application starts, connects to the controller and once successful, deploys the containers. The application accepts requests even before the containers are available.
  • true; the deployment of the KIE server application joins the controller connection thread with the main deployment and awaits its completion.

    This option can lead to a potential deadlock in case more applications are on the same server instance. It is strongly recommended to use only one application (the KIE server) on one server instance.

ValuesDefault

true or false

false

org.kie.server.token

This property allows you to use a token-based authentication between the controller and the KIE server instead of the basic user name/password authentication. The controller sends the token as a parameter in the request header. Note that long-lived access tokens are required as the tokens are not refreshed.

ValuesDefault

String

N/A

org.kie.server.user

The user name used to connect with the KIE server from the controller, required when running in managed mode. This property need to be set in Business Central system properties and is required when using a controller.

ValuesDefault

String

kieserver

org.optaplanner.server.ext.disabled

When set to true, disables the BRP support (for example planner support).

ValuesDefault

true or false

false

Important

A new DataSource for the Realtime Decision Server must point to a different database schema than the DataSource used by Business Central.

If you are running both the Realtime Decision Server and the Business Central, make sure that each uses a different DataSource (by modifying the org.kie.server.persistence.ds property), in order to avoid conflicts.

10.3.2. Managed Realtime Decision Server

A managed instance requires an available controller to start up the Realtime Decision Server.

A Controller is a component that keeps and manages a Realtime Decision Server configuration in a centralized way. Each controller can manage multiple configurations at once, and there can be multiple controllers in the environment. Managed Realtime Decision Server can be configured with a list of controllers, but will only connect to one at a time.

Important

Controllers should be kept in sync to ensure that the same set of configuration is provided to the server, regardless of which controller it connects to.

When the Realtime Decision Server is configured with a list of controllers, it will attempt to connect to each of them at startup until a connection is successfully established with one of them. If for some reason a connection cannot be established, the server will not start, even if there is a local storage available with configuration. This ensures consistence, and prevents the server from running with redundant configuration.

Note

To run the Realtime Decision Server in standalone mode without connecting to controllers, see Section 10.3.4, “Unmanaged Realtime Decision Server”.

10.3.3. Registering Realtime Decision Server

To register a new managed Realtime Decision Server instance, set the following properties in standalone.xml:

<property name="org.kie.server.user" value="anton"></property>
<property name="org.kie.server.pwd" value="password1!"></property>
<property name="org.kie.server.location" value="http://localhost:8080/kie-server/services/rest/server"></property>
<property name="org.kie.server.controller" value="http://localhost:8080/business-central/rest/controller"></property>
<property name="org.kie.server.controller.user" value="kieserver"></property>
<property name="org.kie.server.controller.pwd" value="kieserver1!"></property>
<property name="org.kie.server.id" value="local-server-123"></property>

The standalone.xml file is located in the $SERVER_HOME/standalone/configuration/ directory.

org.kie.server.user must have the kie-server role assigned.

Warning

org.kie.server.location points to the same host as org.kie.server.controller. This is not suitable for production.

To create the kieserver user:

  1. Change into $SERVER_HOME/bin/.
  2. Execute the following command:

    $ ./add-user.sh -a --user kieserver --password kieserver1! --role kie-server

To verify successful start of the Realtime Decision Server, send a GET request to http://SERVER:PORT/kie-server/services/rest/server/. Once authenticated, you will see an XML response:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response type="SUCCESS" msg="Kie Server info">
    <kie-server-info>
        <capabilities>BRM</capabilities>
        <capabilities>BPM-UI</capabilities>
        <capabilities>BPM</capabilities>
        <capabilities>BRP</capabilities>
        <capabilities>KieServer</capabilities>
        <location>http://localhost:8080/kie-server/services/rest/server</location>
        <messages>
            <content>Server KieServerInfo{serverId='local-server-123', version='6.4.0.Final-redhat-3', location='http://localhost:8080/kie-server/services/rest/server'}started successfully at Fri Jun 03 13:48:44 CEST 2016</content>
            <severity>INFO</severity>
            <timestamp>2016-06-03T13:48:44.606+02:00</timestamp>
        </messages>
        <name>local-server-123</name>
        <id>local-server-123</id>
        <version>6.4.0.Final-redhat-3</version>
    </kie-server-info>
</response>

To verify successful registration, log into the Business Central and select DeployRule Deployments. If successful, you will see the registered server ID.

10.3.4. Unmanaged Realtime Decision Server

An unmanaged Realtime Decision Server is a standalone instance, and therefore must be configured individually using REST/JMS API from the Realtime Decision Server itself. There is no controller involved. The configuration is automatically persisted by the server into a file and that is used as the internal server state, in case of restarts.

The configuration is updated during the following operations:

  • Deploy KIE Container
  • Undeploy KIE Container
  • Start KIE Container
  • Stop KIE Container
Note

If the Realtime Decision Server is restarted, it will attempt to re-establish the same state that was persisted before shutdown. Therefore, KIE Containers that were running will be started, but the ones that were stopped will not.