Skip to main content

Event Reference

This document provides a comprehensive list of events supported by the HiveMQtt client library. These events are categorized into two sections: General and Packet Level.

General Events

General events are triggered by high-level operations such as connecting, subscribing, unsubscribing, and receiving messages.

EventEventArgs ClassEvent Arguments
BeforeConnectBeforeConnectEventArgsHiveMQClientOptions
AfterConnectAfterConnectEventArgsConnectResult
BeforeSubscribeBeforeSubscribeEventArgsSubscribeOptions
AfterSubscribeAfterSubscribeEventArgsSubscribeResult
BeforeUnsubscribeBeforeUnsubscribeEventArgsUnsubscribeOptions
AfterUnsubscribeAfterUnsubscribeEventArgsUnsubscribeResult
OnMessageReceivedOnMessageReceivedEventArgsMQTT5PublishMessage
BeforeDisconnectBeforeDisconnectEventArgsNone
AfterDisconnectAfterDisconnectEventArgsCleanDisconnect

Packet Level Events

Packet level events are triggered by the underlying MQTT packet activity. These events provide a more granular level of control and can be useful for debugging or advanced use cases.

EventEventArgs ClassEvent Arguments
OnConnectSentOnConnectSentEventArgsConnectPacket
OnConnAckReceivedOnConnAckReceivedEventArgsConnAckPacket
OnConnectSentOnConnectSentEventArgsConnectPacket
OnDisconnectReceivedOnDisconnectReceivedEventArgsDisconnectPacket
OnDisconnectSentOnDisconnectSentEventArgsDisconnectPacket
OnPingReqSentOnPingReqSentEventArgsPingReqPacket
OnPingRespReceivedOnPingRespReceivedEventArgsPingRespPacket
OnPublishSentOnPublishSentEventArgsPublishPacket
OnPublishReceivedOnPublishReceivedEventArgsPublishPacket
OnPubAckSentOnPubAckSentEventArgsPubAckPacket
OnPubAckReceivedOnPubAckReceivedEventArgsPubAckPacket
OnPubRecSentOnPubRecSentEventArgsPubRecPacket
OnPubRecReceivedOnPubRecReceivedEventArgsPubRecPacket
OnPubRelSentOnPubRelSentEventArgsPubRelPacket
OnPubRelReceivedOnPubRelReceivedEventArgsPubRelPacket
OnPubCompSentOnPubCompSentEventArgsPubCompPacket
OnPubCompReceivedOnPubCompReceivedEventArgsPubCompPacket
OnSubscribeSentOnSubscribeSentEventArgsSubscribePacket
OnSubAckSentOnSubAckSentEventArgsSubAckPacket
OnUnsubscribeSentOnUnsubscribeSentEventArgsUnsubscribePacket
OnUnsubAckSentOnUnsubAckSentEventArgsUnsubAckPacket