         self.connectWithRetry(0, nil, completion)
     }
     
-    public func publish(_ data: Data, in topic: String, delivering qos: MQTTQoS, retain: Bool, completion: MQTTSessionCompletionBlock?) {
-        self.session?.publish(data, in: topic, delivering: qos, retain: retain, completion: completion)
+    public func publish(_ data: Data, in topic: String, withMsgID msgID: UInt16, delivering qos: MQTTQoS, retain: Bool, completion: MQTTSessionCompletionBlock?) {
+        self.session?.publish(data, in: topic, withMsgID: msgID, delivering: qos, retain: retain, completion: completion)
     }
     
     public func subscribe(to topics: [String: MQTTQoS], completion: MQTTSessionCompletionBlock?) {

    }
	
	private func doResuscitate(_ completion: MQTTSessionCompletionBlock?) {
		self.connect { [weak self] success, newError in
			if success {
				completion?(success, newError)
			}
			else if let retry = self {
				retry.connectResuscitate(completion)
			}
			else {
				completion?(false, newError)
			}
		}
	}

extension MQTTReconnectingSession {
    fileprivate func connectWithRetry(_ attempt: Int, _ error: Error?, _ completion: MQTTSessionCompletionBlock?) {
		if let session = session {
			session.connect { [weak self] msgID, success, newError in
				if success {
					completion?(msgID, success, newError)
					if let inform = self {
						inform.delegate?.mqttConnected( true, for: inform, error: newError )
					}
				}
				else if let retry = self {
					retry.doRetry(attempt, newError , completion)
				}
				else {
					completion?(msgID, false, newError )
				}
			}
		}
