title: Python + STOMP not receiving messages from ActiveMQ
body: <p>I recently had a task to make Python script which can read/receive and show message from ActiveMQ. It has the methods <code>on_message</code> and <code>on_error</code> which print &quot;received message...&quot; and &quot;received error...&quot; respectively. Unfortunately neither prints anything even though it has connection to ActiveMQ.
  <img src="https://i.stack.imgur.com/e0AEA.png" alt="As you can see I created topic in web console named &quot;topictest&quot;" /></p>
  <pre><code>import time
  import sys
  import stomp
  
  class ConnectionListener(object):
      def on_error(self, message):
          print('received an error %s' % message)
      def on_message(self, message):
          print('received a message %s' % message)
          print(message.body)
          with open('/usr/ubuntu/result.txt', 'w') as txt_file:
              txt_file.write(str(message))
  conn = stomp.Connection(host_and_ports=[('localhost', 61613)])
  conn.set_listener('', ConnectionListener())
  
  
  conn.connect(&quot;admin&quot;, &quot;admin&quot;, wait=True)
  
  conn.subscribe(destination='/topic/topictest', id='1', ack='auto')
  
  time.sleep(2)
  conn.disconnect()
  </code></pre>
  <p>Maybe the problem is on destination I gave. So I tried to change <code>destination='/topic/...'</code>. Nothing happens. I need my code to show the message.</p>