             mosquitto_username_pw_set(mosquittoContext.mosquittoHandler, mqttAuthOpts.username.cCharArray, mqttAuthOpts.password.cCharArray)
         }
         
+        // set MQTT Publish Options
+        if let mqttPublishOpts = mqttConfig.mqttPublishOpts {
+            mosquitto_max_inflight_messages_set(mosquittoContext.mosquittoHandler, mqttPublishOpts.max_inflight_messages)
+            mosquitto_message_retry_set(mosquittoContext.mosquittoHandler, mqttPublishOpts.message_retry)
+        }
+        
         // start MQTTClient
         let mqttClient = MQTTClient(mosquittoContext: mosquittoContext)
         let host = mqttConfig.host

        }
    }

    private func synchronized(operation: (__MosquittoContext, NSOperationQueue) -> Void) {
        objc_sync_enter(self)
        if (!isFinished) {

    public var mqttReconnOpts: MQTTReconnOpts
    public var mqttWillOpts: MQTTWillOpts?
    public var mqttAuthOpts: MQTTAuthOpts?
    public var mqttPublishOpts: MQTTPublishOpts?
    
    public var onConnectCallback: ((returnCode: Int) -> Void)?
    public var onDisconnectCallback: ((reasonCode: Int) -> Void)!
