Skip to main content
HiveMQ

HiveMQtt

HiveMQ MQTT & Sparkplug Clients for C#/.NET

Build reliable, high-performance IoT applications with HiveMQ's official C#/.NET client lineup: HiveMQtt, RawClient, and HiveMQtt.Sparkplug.

NuGet VersionNuGet DownloadsLicense
📦

Install in Seconds

dotnet add package HiveMQtt

Available on NuGet • Supports .NET 6, 7, 8, 9, and 10

Choose Your Client Path

Start with the client that matches your use case, then dive into targeted docs.

1

HiveMQtt MQTT Client

Best for most applications

Use the full-featured MQTT 5 client with subscription tracking, convenient callbacks, and production-ready defaults.

Explore HiveMQtt
2

RawClient MQTT Client

Best for performance-critical scenarios

Use the low-level RawClient API for minimal overhead, direct packet handling, and custom message routing.

Explore RawClient
3

Sparkplug Client

Best for industrial Sparkplug B 3.0

Build Host Applications and Edge Nodes with Sparkplug topic/payload support powered by HiveMQtt.Sparkplug.

Explore Sparkplug

Why Choose HiveMQtt?

Built by the MQTT experts at HiveMQ for production-grade IoT applications

🚀

MQTT 5.0 Ready

Fully compliant with the latest MQTT 5.0 specification. Supports all QoS levels, retained messages, and session management.

High Performance

Asynchronous design optimized for high-throughput and low-latency. Benchmarked for production IoT workloads.

🔒

Enterprise Security

TLS/SSL, X.509 certificates, SecureString password storage, and secure WebSocket (wss://) support.

🌐

Flexible Transport

TCP and WebSocket connections (ws:// and wss://). Works across firewalls and HTTP-only environments.

🎯

Developer Friendly

Intuitive API with smart defaults, builder patterns, and extensive event system for fine-grained control.

📦

Multi-Platform

Supports .NET 6, 7, 8, 9, and 10. Works on Windows, Linux, macOS, and containerized environments.

Simple, Intuitive API

Get connected and start publishing messages in minutes. The HiveMQtt client features a clean, builder-based API that makes MQTT integration straightforward.

  • ✓ Async/await pattern throughout
  • ✓ Fluent builder configuration
  • ✓ Event-driven message handling
  • ✓ Automatic reconnection support
  • ✓ Per-subscription handlers
View Full Documentation
QuickStart.cs
using HiveMQtt.Client;
using HiveMQtt.MQTT5.Types;

// Connect to HiveMQ Cloud (or any MQTT broker)
var options = new HiveMQClientOptionsBuilder()
.WithBroker("your-cluster.hivemq.cloud")
.WithPort(8883)
.WithUseTls(true)
.WithUserName("your-username")
.WithPassword("your-password")
.Build();

var client = new HiveMQClient(options);

// Handle incoming messages
client.OnMessageReceived += (sender, args) => {
Console.WriteLine($"Received: {args.PublishMessage.PayloadAsString}");
};

await client.ConnectAsync();
await client.SubscribeAsync("sensors/temperature");
await client.PublishAsync("sensors/temperature", "23.5°C");

Built for Real-World IoT

From edge devices to enterprise systems, HiveMQtt powers mission-critical applications

🏭

Industrial IoT

Connect factory equipment, sensors, and PLCs to your enterprise systems.

🏠

Smart Buildings

Build automation systems for HVAC, lighting, and energy management.

🚗

Connected Vehicles

Real-time telemetry and fleet management for automotive applications.

⚕️

Healthcare

Medical device connectivity and patient monitoring systems.

Powered by HiveMQ

HiveMQ is the enterprise MQTT platform trusted by leading organizations worldwide. With 99.999% uptime, support for millions of concurrent connections, and seamless integration with enterprise systems, HiveMQ is the foundation for your IoT success.

200M+Concurrent Connections
1M+Messages/Second
99.999%Uptime SLA

Ready to Build?

Start building your IoT application today with HiveMQtt and HiveMQ Cloud.
Free tier includes up to 100 device connections — no credit card required.