• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
CDP Studio logo

CDP Studio

The no-code and full-code software development tool for distributed control systems and HMI

  • Doc
  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Products
    • Automation Designer
    • HMI Designer
    • Maritime HMIs
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • Protocols - MQTT I/O
  • MQTT Broker
  • 5.0.0

Topics MQTT Tutorials

MQTT Broker

MQTT Broker

Introduction

To use the MQTT protocol a central broker has to exist. All the connection handling, message forwarding, buffering and re-delivering (at network interrupts) are managed by the MQTT broker. All MQTT clients communicate with each other only via the broker.

In general, there are two alternatives to running the broker:

  • to use some existing, public broker service (f.e. cloud broker):
    • more secure to use over the Internet (no need to open network for incoming TCP connections)
    • somewhat easier to start with - all broker setup and maintenance is done by the third-party (service provider)
  • to set up and use system own, private broker:
    • settings, reliability and security are more under system owner control
    • no sign-up nor agreements needed by third parties (service providers)

CDP has a simple MQTT broker component built in.

MQTTBroker

To use CDP built-in MQTT broker MQTTBroker subcomponent must be added to CDP application.

MQTTBroker has the following configurable properties:

PropertyDescription
ListenAddressAddress broker listens on (IP or hostname). Use '0.0.0.0' to listen on all network interfaces.
ListenPortTCP port broker listens on (recommended values are 1883 for unencrypted and 8883 for encrypted connections)
EncryptionBroker connection encryption. Choose between options:
  • Unencrypted - no encryption
  • TLS - Use TLS certificate-based encryption and authentication. See also TLS certificate setup.
  • TLS-PSK - use TLS Pre-Shared Key-based encryption and authentication. See also TLS-PSK key setup.
TLSCAFileBroker CA certificate file name for TLS encryption. See also TLS certificate setup.
TLSCertFileClient authentication certificate file name (for TLS client authentication). See also TLS certificate setup.
TLSKeyFileBroker key file name for TLS encryption (PEM certificate or PSK list). See also TLS certificate setup and TLS-PSK key setup
TLSRequireClientCertWhen set to true, then every client connecting to the broker must provide a valid (i.e. signed by the broker CA) certificate for the connection to be allowed
MaxTopicAliasThis option sets the maximum number of topic aliases that a MQTT v5 client is allowed to create. Defaults to 10 but can be increased up to 65535. Can be set to 0 to disallow the topic aliases feature from being used.
PersistenceWhen set, then the connection, subscription and retainable payload data will be written to the disk database specified in the PersistenceLocation. When the broker is restarted, it will reload the information stored in that database. The data will be written to disk when the broker suspends and also at intervals as defined by the PersistenceSaveInterval and PersistenceSaveOnChanges. If unset, no persistence is used and the data will be stored in memory only and will be lost on broker stop.
PersistenceDatabaseThe database file name to use for the persistence database, with the optional path prefix, relative to the application folder
PersistenceSaveIntervalSpecifies the persistence database write interval: when PersistenceSaveOnChanges is unset, then it is treated as the interval of seconds that the broker will wait between each time it saves the in-memory database to PersistenceDatabase. When PersistenceSaveOnChanges is set, then this value is treated as the number of subscription changes to wait before they have to be saved to the database. If set to 0, the in-memory database will only be saved when the broker shuts down.
PersistenceSaveOnChangesWhen set, the broker will count the number of subscription changes, retained messages received and queued messages and if the total exceeds PersistenceInterval, then the in-memory database will be saved to disk. When unset, then the PersistenceInterval is treated as a time in seconds.

Topics MQTT Tutorials

The content of this document is confidential information not to be published without the consent of CDP Technologies AS.

CDP Technologies AS, www.cdpstudio.com

Get started with CDP Studio today

Let us help you take your great ideas and turn them into the products your customer will love.

Try CDP Studio for free
Why CDP Studio?

CDP Technologies AS
Hundsværgata 8,
P.O. Box 144
6001 Ålesund, Norway

Tel: +47 990 80 900
E-mail: info@cdptech.com

Company

About CDP

Contact us

Services

Partners

Blog

Developers

Get started

User manuals

Support

Document download

Release notes

My account

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

© Copyright 2025 CDP Technologies. Privacy and cookie policy.

Return to top