title: Receive single message from ActiveMQ queue using python STOMP
body: <ul>
  <li>Hi, I am using stomp.py module to send and receive messages from<br>
  ActiveMQ using python.</li>
  <li>While receiving messages listener will read multiple messages within 
  the specified sleep time.</li>
  <li>But I need to read only a single message. It's possible in java. How 
  can I read a single message from ActiveMQ using STOMP?</li>
  </ul>
  
  <p>Here is the listener script which I am testing,</p>
  
  <pre><code>import stomp
  import time
  
  class SampleListener(object):
    def on_message(self, headers, msg):
      print(msg)
  
  conn = stomp.Connection([('localhost',61613)]) 
  conn.set_listener('SampleListener', SampleListener()) 
  conn.start() 
  conn.connect() 
  conn.subscribe(destination='queue_name', id=1, ack='auto')
  time.sleep(10) # secs 
  conn.disconnect()
  </code></pre>