Configuration and Usage
Below are the details to configure and use ComDeX through its command-line interface and to set up broker federations using MQTT bridges.
Command-Line Usage
ComDeX provides a flexible command-line interface for managing entities, subscriptions, and other operations.
Usage:
    python3 actionhandler.py [options]
    Options
| Option | Long Form | Description | 
|---|---|---|
| -h | --help | Show help information about available commands and options. | 
| -c | --command | Specify the operation to perform. Possible commands include: 
 | 
| -f | --file | Specify the input file for the command (e.g., an entity configuration file). | 
| -b | --broker_address | Specify the MQTT broker address for the ComDeX node. | 
| -p | --port | Specify the port number of the MQTT broker for the ComDeX node. | 
| -q | --qos | Define the Quality of Service level (0, 1, or 2) for the command. | 
| -H | --HLink | Provide the context link (HLink) for the GET request. | 
| -A | --singleidadvertisement | Set to 1to enable single ID advertisement; default is0. | 
Example:
python3 actionhandler.py -c POST/entities -f entity.ngsild -b localhost -p 1026 -q 1 -H HLink -A 0
    Setting Up Broker Federations
ComDeX supports MQTT-based broker federation for propagating context between brokers. The implementation relies on advertisement messages containing:
- Provider ID
- Broker address and port
- Region covered
- NGSI-LD entity context and type
Configuration Guidelines
To set up a federation:
- Configure MQTT bridges between brokers using advertisement messages to propagate exported contexts.
- Ensure proper filtering to avoid redundant message transmissions and network overload.
- Avoid bidirectional linkages in MQTT bridges to reduce network loops.
Example MQTT Broker Configuration
# Mosquitto .conf example for allowing all advertisements
    max_queued_messages 4000
    persistence true
    persistence_location ./Port_Area_B_Broker/
    log_dest stdout
    listener 1029 localhost
    allow_anonymous true
    
    connection Port_Area_B_Broker_to_Port_Administration_Central_Broker
    address localhost:1026
    topic provider/# out 2 "" ""
    With this configuration, the broker propagates advertisements and entity data as defined.