title: Tornado on pika consumer can't run
body: <p>I want to build monitoring system using RabbitMQ and Tornado. I can run the producer and my consumer can consume the data on queue but the data cant be show on website.</p>
  
  <p>This just my experiment before I using the sensor</p>
  
  <pre><code>import pika
  import tornado.ioloop
  import tornado.web
  import tornado.websocket
  import logging
  from threading import Thread
  
  logging.basicConfig(lvl=logging.INFO)
  clients=[]
  
  credentials = pika.credentials.PlainCredentials('ayub','ayub')
  connection = pika.BlockingConnection(pika.ConnectionParameters('192.168.43.101',
                                  5672,
                                  '/',
                                  credentials))
  channel = connection.channel()
  
  def threaded_rmq():
      channel.basic_consume('Queue',
                              on_message_callback= consumer_callback,
                              auto_ack=True,
                              exclusive=False,
                              consumer_tag=None,
                              arguments=None)
  
      channel.start_consuming()
  
  def disconect_rmq():
      channel.stop_consuming()
      Connection.close()
      logging.info('Disconnected from broker')
  
  def consumer_callback(ch,method,properties,body):
      for itm in clients:
          itm.write_message(body)
  class SocketHandler(tornado.websocket.WebSocketHandler):
      def open(self):
          logging.info('websocket open')
          clients.remove(self)
  
      def close(self):
          logging.info('websocket closed')
          clients.remove(self)
  
  class MainHandler(tornado.web.RequestHandler):
      def get(self):
          self.render("websocket.html")
  
  application = tornado.web.Application([
      (r'/ws',SocketHandler),
      (r"/", MainHandler),
  ])
  
  def startTornado():
      application.listen(8888)
      tornado.ioloop.IOLoop.instance().start()
  
  def stopTornado():
      tornado.ioloop.IOLoop.instance().stop()
  
  if __name__ == "__main__":
      logging.info('starting thread RMQ')
  
      threadRMQ = Thread(target=threaded_rmq)
      threadRMQ.start()
      logging.info('starting thread tornado')
  
      threadTornado = Thread(target=startTornado)
      threadTornado.start()
  
      try:
          raw_input("server ready")
      except SyntaxError:
          pass
      try:
          logging.info('disconnected')
          disconnect_rmq()
      except Exception, e:
          pass
      stopTornado()
  </code></pre>
  
  <p>but I got this error</p>
  
  <pre><code>WARNING:tornado.access:404 GET /favicon.ico (192.168.43.10) 0.98ms
  </code></pre>
  
  <p>please help me</p>