title: Acknowledgement on publish - MQTT
body: <p>How to identify whether the <code>publish</code> to a <code>topic</code> was success or not. Is there any way to get acknowledgement on publishing to a topic.</p>
  
  <p>If there is any connection loss during <code>publish</code> between the clients(<strong>Publisher/Subscriber)</strong> how to handle it.</p>
  
  <p>I don't want the subscriber to send an ack to specific topic in the publishing end after receiving the pay_load.</p>
  
  <p><strong>Here is my ruby code:</strong></p>
  
  <p>Assume, I have created clients<code>(@client)</code> and configured on both sides.</p>
  
  <h1>Publish</h1>
  
  <pre><code>def publish_it
    @client.publish('test/hai', 'message')
    # Ack the publish
  end
  </code></pre>
  
  <h1>Subscribe</h1>
  
  <pre><code>@client.subscribe('test/#')
  
  @client.get do |topic,message|
    puts "#{topic}: #{message}"
  end
  </code></pre>