super.onReSubscribe(mqttSubscription);
}
@Override
public void onUnSubscribe(String topicName) throws MQTTProtocolException {
MQTTSubscription subscription = mqttSubscriptionByTopic.remove(topicName);
if (subscription != null) {
doUnSubscribe(subscription);
// check if the durable sub also needs to be removed
if (subscription.getConsumerInfo().getSubscriptionName() != null) {
// also remove it from restored durable subscriptions set
restoredSubs.remove(MQTTProtocolSupport.convertMQTTToActiveMQ(subscription.getTopicName()));
RemoveSubscriptionInfo rsi = new RemoveSubscriptionInfo();
rsi.setConnectionId(protocol.getConnectionId());
rsi.setSubscriptionName(subscription.getConsumerInfo().getSubscriptionName());
rsi.setClientId(protocol.getClientId());
protocol.sendToActiveMQ(rsi, new ResponseHandler() {
@Override
public void onResponse(MQTTProtocolConverter converter, Response response) throws IOException {
// ignore failures..