Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[tool.bumpversion]
current_version = "1.1.0"
commit = true
tag = true
tag_name = "v{new_version}"
tag_message = "Automatic version bump {current_version} -> {new_version}"
message = "[skip actions] Automatic version bump {current_version} -> {new_version}"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]

[[tool.bumpversion.files]]
filename = "images-manifest.yml"
search = "version: {current_version}"
replace = "version: {new_version}"
22 changes: 8 additions & 14 deletions .github/workflows/docker-ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: "Build&Deploy mqtt-broker images"

name: "Build&Deploy docker images"
on:
# Trigger the workflow on push or pull request
# but only for the main branch
# or on tag of type v*.*.*
push:
branches:
- main
Expand All @@ -12,21 +8,16 @@ on:
pull_request:
branches:
- main
- dev
release:
types: [released]
jobs:
mqtt-broker:
uses: MOV-AI/.github/.github/workflows/docker-workflow.yml@v2
build-and-deploy:
uses: MOV-AI/.github/.github/workflows/docker-workflow.yml@v3
with:
docker_file: ./Dockerfile
docker_image: qa/mqtt-broker
manifest_file: images-manifest.yml
create_release: ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/tags/v') }}
deploy: ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/tags/v')}}
version: ${GITHUB_REF##*/}
push_latest: ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/tags/v') }}
public: true
public_image: ce/mqtt-broker
snyk_check: true
secrets:
registry_user: ${{ secrets.PORTUS_APP_USER }}
registry_password: ${{ secrets.PORTUS_APP_TOKEN }}
Expand All @@ -35,3 +26,6 @@ jobs:
github_registry_user: ${{ secrets.RAISE_BOT_COMMIT_USER }}
github_registry_password: ${{ secrets.RAISE_BOT_COMMIT_PASSWORD }}
snyk_token: ${{ secrets.SNYK_TOKEN }}
commit_user: ${{ secrets.RAISE_BOT_COMMIT_USER }}
commit_mail: ${{ secrets.RAISE_BOT_COMMIT_MAIL }}
commit_token: ${{ secrets.RAISE_BOT_COMMIT_PASSWORD }}
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@ All notable changes to the MQTT Broker container project are documented in this
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 1.1.0 [2024-06-01]

### Added
- HiveMQ Community Edition 2026.5 support (upgraded from 2025.5)
- JMX metric writer disabled by default to prevent startup errors in containerized environments
- Enhanced control packet size limits for improved DoS protection
- Optimized heap memory thresholds for predictable performance under 2026.5

## 1.0.0 [Unreleased]

### Added
- Comprehensive documentation suite
- HiveMQ Community Edition 2025.5 support
- InfluxDB extension v4.1.7 for metrics collection
- Comprehensive monitoring stack with Chronograf and Kapacitor for development
- Robot fleet optimized configuration
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG HIVEMQ_CE_VERSION=2025.5
ARG HIVEMQ_CE_VERSION=2026.5

FROM hivemq/hivemq-ce:${HIVEMQ_CE_VERSION}

Expand All @@ -10,6 +10,7 @@

# Environment variables
ENV ENV="release" \
HIVEMQ_JMX_ENABLED=false \
HIVEMQ_INFLUXDB_EXTENSION_VERSION="4.1.7"

# Copy configuration files
Expand All @@ -18,7 +19,7 @@
# Install plugins
# 1. HiveMQ InfluxDB Monitoring Extension
USER root
RUN apt-get update && apt-get install -y --no-install-recommends unzip && \

Check failure on line 22 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-deploy / static-analyze (mqtt-broker, Dockerfile, qa/mqtt-broker, ce/mqtt-broker, linux/amd64, true, false...

DL3008 warning: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives && \
curl -L -f "https://github.com/hivemq/hivemq-influxdb-extension/releases/download/${HIVEMQ_INFLUXDB_EXTENSION_VERSION}/hivemq-influxdb-extension-${HIVEMQ_INFLUXDB_EXTENSION_VERSION}.zip" \
-o /tmp/hivemq-influxdb-extension.zip && \
Expand All @@ -29,4 +30,4 @@
USER 10000

HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD bash -c "echo > /dev/tcp/localhost/1883" || exit 1
CMD bash -c "echo > /dev/tcp/localhost/1883" || exit 1
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MQTT Broker Container

Production-ready MQTT broker solution based on HiveMQ Community Edition 2025.5, optimized for IoT devices and robot fleet management with integrated InfluxDB monitoring.
Production-ready MQTT broker solution based on HiveMQ Community Edition 2026.5, optimized for IoT devices and robot fleet management with integrated InfluxDB monitoring.

## Features

Expand Down Expand Up @@ -44,11 +44,18 @@ docker build -t mqtt-broker .

| Variable | Default | Description |
|----------|---------|-------------|
| `HIVEMQ_CE_VERSION` | `2025.5` | HiveMQ version |
| `HIVEMQ_CE_VERSION` | `2026.5` | HiveMQ version |
| `JAVA_OPTS` | `
` | JVM options, including heap cap |
| `INFLUXDB_URL` | `http://influxdb:8086` | InfluxDB connection |
| `INFLUXDB_USERNAME` | `telegraf` | InfluxDB username |
| `INFLUXDB_PASSWORD` | `telegraf` | InfluxDB password |

**Notes**:
- Adjust `JAVA_OPTS` for production workloads to balance performance and resource usage.
- Default value `HIVEMQ_JMX_ENABLED=false` disables **Java Management Extensions (JMX)**, which HiveMQ CE 2026.5 enables by default.
JMX is a Java protocol for remote monitoring and management of the JVM (heap, threads, garbage collection, etc.).

### Key Settings (config/config.xml)

- Session expiry: 24 hours
Expand All @@ -67,6 +74,18 @@ database=metrics
reportingInterval=10
```

## Comparison 2025.5 vs 2026.5

Metric/Dimension | HiveMQ-CE 2025.5 | HiveMQ-CE 2026.5 | Impact
--- | --- | --- | ---
CPU: Steady-State Load | Moderate; higher context-switching during connection churn. | Low; optimized Netty event-loops and fewer cryptographic cycles. | Lower overall CPU usage per node; higher headroom for container auto-scaling.
CPU: Under Attack / Malformed Traffic | High; spikes due to validation logic processing bad payloads. | Extremely Low; drops packets immediately at the fixed header. | Prevents denial-of-service (DoS) via CPU starvation.
Memory: Heap Profile | Bursty/Sawtooth; high allocation rate requires frequent GC sweeps. | Flatter/Predictable; strict early packet limits protect the heap. | Minimizes the risk of JVM Out-Of-Memory (OOM) kills in Kubernetes.
Memory: Per-Client Footprint | Baseline (~X KB per idle connection). | ~5-10% lower per-client overhead (via SDK 4.52.0 maps). | Allows higher client density on the same instance/node sizes.
TLS Handshake Efficiency | 2 Round-Trips (RTT) on standard legacy ciphers. | 1 Round-Trip (RTT) optimized for TLS 1.3 / ECDHE. | Drastically speeds up reconnection times for fleet devices on cellular networks.
Underlying Base Image | eclipse-temurin:21-jre-noble | Updated Eclipse Temurin Base with matured runtime patches. | Benefits from core JVM-level security and threading optimizations.


## Production Security

**Important**: This configuration is for development. For production:
Expand Down Expand Up @@ -112,7 +131,7 @@ docker compose logs -f

Build with custom HiveMQ version:
```bash
docker build --build-arg HIVEMQ_CE_VERSION=2025.4 -t mqtt-broker .
docker build --build-arg HIVEMQ_CE_VERSION=2026.5 -t mqtt-broker .
```

Clean and rebuild:
Expand Down
13 changes: 8 additions & 5 deletions config/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xsi:noNamespaceSchemaLocation="config.xsd">

<!-- =============================================== -->
<!-- HiveMQ Community Edition 2025.5 Configuration -->
<!-- HiveMQ Community Edition 2026.5 Configuration -->
<!-- Optimized for Robot Fleet Management -->
<!-- =============================================== -->

Expand Down Expand Up @@ -168,6 +168,9 @@

<!-- Maximum subscriptions per client -->
<max-subscriptions-per-client>1000</max-subscriptions-per-client>

<!-- Control packet size limits (2026.5 enhancement) -->
<max-packet-size>4096</max-packet-size>
</restrictions>

<!-- MQTT Add-ons -->
Expand Down Expand Up @@ -222,7 +225,7 @@
<enabled>true</enabled>
<metric-writers>
<jmx>
<enabled>true</enabled>
<enabled>false</enabled>
</jmx>
</metric-writers>
</metrics>
Expand All @@ -233,8 +236,8 @@

<!-- Memory thresholds -->
<heap-memory>
<critical-threshold>95</critical-threshold>
<soft-threshold>80</soft-threshold>
<critical-threshold>90</critical-threshold>
<soft-threshold>75</soft-threshold>
</heap-memory>

<!-- Connection limits -->
Expand Down Expand Up @@ -281,4 +284,4 @@
<enabled>true</enabled>
</usage-tracking>

</hivemq>
</hivemq>
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ services:
- TZ=Europe/Lisbon
- TZDATA_TZ=Europe/Lisbon
- TZDATA=/usr/share/zoneinfo
- JAVA_OPTS=-XX:+UnlockExperimentalVMOptions -XX:+UseNUMA -Xms350m -Xmx512m
depends_on:
- influxdb
networks:
Expand All @@ -68,4 +69,4 @@ volumes:

networks:
influxdb:
driver: bridge
driver: bridge
8 changes: 8 additions & 0 deletions images-manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 1.1.0

images:
- name: mqtt-broker
docker_file: Dockerfile
docker_image: qa/mqtt-broker
public_image: ce/mqtt-broker
public: true
Loading