* Copyright 2014 dc-square GmbH
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
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
it's possible to optionally disconnect the
This callback is not meant to implement authorization (= Topic Restrictions). You should
for that purpose
as this offers more fine grained actions and extension points.
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
Use the static copy method of the PUBLISH class for this purpose. Similar to the following code example.
PUBLISH copy = PUBLISH.copy(publish);
message which was sent
clientDatathe information of the publishing client
com.dcsquare.hivemq.spi.callback.exception.OnPublishReceivedExceptionwhen the PUBLISH was invalid.
void onPublishReceived(PUBLISH publish, ClientData clientData) throws OnPublishReceivedException;