public interface OnPublishReceivedCallback extends SynchronousCallback
PUBLISH MQTT message arrives.
This callback gets called very often, so make sure you are NOT blocking and you are using
proper caching
When throwing a OnPublishReceivedException it's possible to optionally disconnect the
publishing client.
This callback is not meant to implement authorization (= Topic Restrictions). You should
use the OnAuthorizationCallback for that purpose
as this offers more fine grained actions and extension points.| Modifier and Type | Method and Description |
|---|---|
void |
onPublishReceived(PUBLISH publish,
ClientData clientData)
Called when a
PUBLISH MQTT message arrives
The publish parameter references the publish object, that is sent to the subscribers,
after the onPublishReceived method was called. |
priorityvoid onPublishReceived(PUBLISH publish, ClientData clientData) throws OnPublishReceivedException
PUBLISH MQTT message arrives
The publish parameter references the publish object, that is sent to the subscribers,
after the onPublishReceived method was called. So if you don“t want your plugin to
interfere in the regular publishing process, you must copy the PUBLISH object.
Use the static copy method of the PUBLISH class for this purpose. Similar to the following code example.
PUBLISH copy = PUBLISH.copy(publish);publish - the PUBLISH message which was sentclientData - the information of the publishing clientOnPublishReceivedException - when the PUBLISH was invalid.Copyright © 2013-2018 dc-square GmbH. All Rights Reserved.