Skip to main content
Skip table of contents

Advanced Configuration

This chapter contains advanced configurations of the Flow Director Platform. A normal user can usually skip this.

Default Configuration

Messaging and Routing Ports

Flow Director contains an embedded SwiftMQ CE router that can be used for AMQP, JMS, and MQTT clients to connect and exchange messages just like a standalone SwiftMQ router. It further defines a Routing listener so that SwiftMQ routers can connect.

During startup of Flow Director (startserver), an internal preconfig file is applied to the standard SwiftMQ configuration that enables all protocols on these ports:

  • AMQP: 45672

  • MQTT: 41883

  • JMS: 44001

  • Routing Listener: 44100

Flow Director uses ports different from the protocol’s standard port to avoid clashing with SwiftMQ routers running on the same host.

Authentication

This part is the standard SwiftMQ configuration of authentication disabled and the default user and group.

Flow Director Server Connection

After starting the embedded SwiftMQ router, Flow Director server establishes two intravm connections. Both use username admin with password secret to authenticate.

Applying your own Configuration

To configure the embedded SwiftMQ router to fulfill your needs, you need to create your own preconfig file and pass it as the 2nd parameter to the startserver script:

CODE
./startserver mypreconfig.xml

The first parameter is your preconfig file that is applied to the router’s configuration after Flow Director’s default preconfig file.

If you are using Docker, map the directory where your preconfig file is stored and set environment variable SWIFTMQ_PRECONFIG accordingly:

CODE
docker run -d --name flowdirector --restart=unless-stopped -u 0 -p 8080:8080  \
-v `pwd`/data/apps:/flowdirector/apps \
-v `pwd`/data/log:/flowdirector/log \
-v `pwd`/data/config:/flowdirector/config  \
-v /site/preconfig:/swiftmq/preconfig \
-v `pwd`/router/data:/flowdirector/router/data \
-e SWIFTMQ_PRECONFIG=/swiftmq/preconfig/router1.xml flowdirector/fdserver:latest

Your preconfig file can contain any changes, i.e., apply a different router name, declare queues, disable protocols, change ports, enable authentication, add users, and so on.

Note: Changing the router name requires that no apps are installed in this Flow Director instance!

In case you change the default admin user or its password, you need to tell Flow Director to use a different user/password for its internal intravm connections by setting these environment variables before executing startserver:

BASH
export FD_JMS_USERNAME=fduser
export FD_JMS_PASSWORD=topsecret
./startserver mypreconfig.xml

Changing the Heap Size

Flow Director server per default starts with a heap size of 2G. You can change it by setting this environment variable before executing startserver:

BASH
export FD_HEAP=4G
./startserver mypreconfig.xml

Changing the Network Mode

The network mode specifies whether Flow Director manages the whole connected router network or only the local (embedded) router.

  • Enabled (default): Flow Director deploys all apps on all routers and all routers are visible by all Flow Director Apps.

  • Disabled: Flow Director will only manage the local (embedded) router and only this router is visible.

Keep in mind: Even if you run with disabled network mode doesn’t mean you can run multiple Flow Director on a single router network. Flow Director apps are using topics internally which are distributed network-wide and may influence each other. Make sure you have only a single Flow Director instance per router network, regardless of the network mode.

You can change the network mode by setting this environment variable before executing startserver:

BASH
export FD_NETWORK_MODE=false
./startserver mypreconfig.xml

Setting your custom JVM Options

You can set your custom JVM options for the virtual machine of Flow Director by setting the environment variable FD_JVM_OPTIONS:

CODE
export FD_JVM_OPTIONS=”-Dhttp.proxyHost=webproxy -Dhttp.proxyPort=7777”
./startserver mypreconfig.xml

DNS Cache TTL

In an environment where IP addresses of DNS hostnames may change, it is important that these changes are detected and the new IPs are used. Per default, Java’s internal DNS caching uses no expiration so it will only be detected when the JVM is restarted. However, there is a way to change that via a Security Manager property (NOT a System property!). You can pass

CODE
export FD_JVM_OPTIONS=”-Dnetworkaddress.cache.ttl=60”
./startserver

in FD_JVM_OPTIONS and Flow Director will set it as a Security Manager property. The value is in seconds. Default is 30 seconds, so you won’t need to set it in normal cases.

Activating the Protocol Multiplexer (MUX)

Flow Director server has an integrated MUX that can multiplex all protocols through a single port. This is especially interesting when Flow Director is deployed as Docker container or in the Cloud. Only the MUX port has to be exposed here.

The MUX is disabled by default. To enable it, set the following environment variables before executing startserver:

BASH
export MUX_ENABLED=true
export MUX_PORT=8081
export MUX_HTTP_PORT=8080
export MUX_AMQP_PORT=-1
export MUX_MQTT_PORT=41883
export MUX_JMS_PORT=44001
export MUX_ROUTING_PORT=-1
./startserver mypreconfig.xml

This example starts the MUX on port 8081 and serves HTTP, MQTT, and JMS connections. AMQP and Routing connections are disabled (-1).

It is even possible to route protocols to other SwiftMQ routers:

BASH
export MUX_ENABLED=true
export MUX_PORT=8081
export MUX_HTTP_PORT=8080
export MUX_AMQP_HOST=anotherhostname
export MUX_AMQP_PORT=45672
export MUX_MQTT_PORT=41883
export MUX_JMS_PORT=44001
export MUX_ROUTING_PORT=-1
./startserver mypreconfig.xml

The default value for the MUX_<protocol>_HOST is localhost so you can usually omit it.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.