Skip to content

Conversation

@ajlennon
Copy link
Member

Summary

This PR adds automatic publishing of version and build information to MQTT when the client connects.

Changes

  • Added PublishVersionInfo() method that publishes version info as JSON to {SendTopic}/version subtopic
  • Updated ConnectedAsync handler to automatically publish version info on successful MQTT connection
  • Added missing System.Linq using statement in VersionInfo.cs

Version Info Payload

The JSON payload includes:

  • Version (semantic version)
  • Assembly version
  • File version
  • Informational version
  • Build date and time (UTC)
  • Git commit hash
  • Full version string
  • MQTT client ID
  • Timestamp (UTC)

Example Topic

If SendTopic is configured as DotnetMQTT/Test/out, version info will be published to:
DotnetMQTT/Test/out/version

Testing

  • Build succeeds without errors
  • Version info will be published automatically on MQTT connect

Please review: @Jen42

Alex J Lennon added 2 commits November 26, 2025 12:36
- Add automatic version info publishing when MQTT client connects
- Publish JSON payload to {SendTopic}/version subtopic
- Include version, build date, git commit hash, client ID, and timestamp
- Add missing System.Linq using in VersionInfo.cs
- Set retain flag on version info message so subscribers receive it immediately
- Ensures version information is always available to new subscribers
@Jen42 Jen42 merged commit cdabbfc into main Nov 26, 2025
1 check passed
@Jen42 Jen42 deleted the feature/mqtt-version-info-publish branch November 26, 2025 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants