Fix issue #171
This commit is contained in:
@@ -561,15 +561,20 @@ public class ProtocolProcessor {
|
|||||||
/**
|
/**
|
||||||
* Specialized version to publish will testament message.
|
* Specialized version to publish will testament message.
|
||||||
*/
|
*/
|
||||||
private void forwardPublishWill(WillMessage will, String clientID) {
|
private void forwardPublishWill(WillMessage will, String clientID) {
|
||||||
LOG.info("Publishing will message. CId={}, topic={}", clientID, will.getTopic());
|
LOG.info("Publishing will message. CId={}, topic={}", clientID, will.getTopic());
|
||||||
// it has just to publish the message downstream to the subscribers
|
// it has just to publish the message downstream to the subscribers
|
||||||
// NB it's a will publish, it needs a PacketIdentifier for this conn, default to 1
|
// NB it's a will publish, it needs a PacketIdentifier for this conn, default to 1
|
||||||
IMessagesStore.StoredMessage tobeStored = asStoredMessage(will);
|
IMessagesStore.StoredMessage tobeStored = asStoredMessage(will);
|
||||||
tobeStored.setClientID(clientID);
|
tobeStored.setClientID(clientID);
|
||||||
Topic topic = new Topic(tobeStored.getTopic());
|
Topic topic = new Topic(tobeStored.getTopic());
|
||||||
this.messagesPublisher.publish2Subscribers(tobeStored, topic);
|
this.messagesPublisher.publish2Subscribers(tobeStored, topic);
|
||||||
}
|
|
||||||
|
//Stores retained message to the topic
|
||||||
|
if(will.isRetained()) {
|
||||||
|
m_messagesStore.storeRetained(topic, tobeStored);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static MqttQoS lowerQosToTheSubscriptionDesired(Subscription sub, MqttQoS qos) {
|
static MqttQoS lowerQosToTheSubscriptionDesired(Subscription sub, MqttQoS qos) {
|
||||||
if (qos.value() > sub.getRequestedQos().value()) {
|
if (qos.value() > sub.getRequestedQos().value()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user