Skip to main content

What are Routes?

Routes define connections between your Coreflux MQTT broker and external systems. They enable broker-to-broker communication, database storage, industrial protocol integration, REST API connectivity, email notifications, AI integration, and media processing - all without writing custom middleware.
Routes extend your broker’s capabilities by creating managed connections to external systems - all configured through LoT syntax.

Route Categories

System Routes

Broker clustering and scalability configurations for high-availability deployments.

Data Pipeline Routes

MQTT bridges, email notifications, and MQTT-to-REST forwarding.

Data Storage Routes

Store MQTT data in PostgreSQL, MySQL, MongoDB, OpenSearch, Snowflake, and more.

REST API Routes

HTTP client/server for external API integration and webhook endpoints.

Industrial Routes

Connect to PLCs via Modbus, Siemens S7, OPC UA, ADS, Allen-Bradley, and FINS.

MCP Routes

Model Context Protocol (MCP) integration for AI assistants.

Media Routes

Barcode scanning and video streaming capabilities.
This page covers the fundamentals of route configuration. Choose a specific route category above for detailed syntax and examples.

Basic Syntax

DEFINE ROUTE <route_name> WITH TYPE <route_type>
    ADD <CONFIG_SECTION>
        WITH <parameter> "<value>"
    ADD MAPPING <mapping_name>
        WITH SOURCE_TOPIC "<source>"
        WITH DESTINATION_TOPIC "<destination>"

Components

route_name
string
required
Unique identifier for the route. Use descriptive names like CloudBridge, SensorDataIndexer, AlertEmailer.
route_type
type
required
The type of route (see Available Route Types below).
CONFIG_SECTION
block
Configuration blocks specific to the route type (e.g., MQTT_CONFIG, MONGODB_CONFIG, REST_API_CONFIG).
MAPPING
block
Defines topic mappings for data flow between source and destination.

Available Route Types

Route TypeDescription
MQTT_CLUSTERBroker clustering and scalability

Quick Examples

Send email notifications from MQTT events:
DEFINE ROUTE AlertEmail WITH TYPE EMAIL
    ADD SMTP_CONFIG
        WITH HOST "smtp.gmail.com"
        WITH PORT '587'
        WITH USERNAME "alerts@company.com"
        WITH PASSWORD "app-password"
        WITH USE_TLS "true"
    ADD EVENT criticalAlert
        WITH SOURCE_TOPIC "alerts/critical/+"
        WITH SUBJECT "Critical Alert: {value.json.type}"
        WITH RECIPIENT "team@company.com"

Common Configuration Patterns

MQTT Configuration

Most routes include an MQTT configuration section. Use the shorthand for the local broker:
ADD MQTT_CONFIG
    WITH BROKER SELF
Or specify connection details explicitly:
ADD MQTT_CONFIG
    WITH BROKER_ADDRESS "127.0.0.1"
    WITH BROKER_PORT '1883'
    WITH CLIENT_ID "MyRouteClient"
    WITH USERNAME "user"
    WITH PASSWORD "password"

Topic Mappings

Define how topics map between source and destination. Wildcards are supported in topic patterns:
ADD MAPPING <mapping_name>
    WITH SOURCE_TOPIC "sensors/+/temperature"
    WITH DESTINATION_TOPIC "processed/+/temperature"
    WITH DIRECTION "<out|in|both>"
Direction Options:
  • out - Source to destination only
  • in - Destination to source only
  • both - Bidirectional sync

Use Cases

Bridge local edge data to cloud brokers:
DEFINE ROUTE EdgeToCloud WITH TYPE MQTT_BRIDGE
    ADD SOURCE_CONFIG
        WITH BROKER SELF
    ADD DESTINATION_CONFIG
        WITH BROKER_ADDRESS "iot.cloud-provider.com"
        WITH BROKER_PORT '8883'
        WITH USE_TLS "true"
    ADD MAPPING allSensors
        WITH SOURCE_TOPIC "local/sensors/#"
        WITH DESTINATION_TOPIC "edge-01/sensors/#"
        WITH DIRECTION "out"

Next Steps

Industrial Routes

Connect to PLCs and industrial equipment.

Data Storage

Store MQTT data in databases.

REST API Routes

HTTP client and server configuration.

Route Examples

See complete route configuration examples.