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:

./startserver mypreconfig.xml
CODE

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:

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
CODE

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:

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

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:

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

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.

Disabling it makes sense when you run a Flow Director instance on each router of a router network. So these Flow Director instances manage their local router only. In network mode, there can only be a single Flow Director instance per router network that manages everything.

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

export FD_NETWORK_MODE=false
./startserver mypreconfig.xml
BASH

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:

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

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:

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
BASH

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:

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
BASH

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