Esempio n. 1
0
def callback(ch, method, properties, body):
    print " [x] Received %r" % (body,)
    print " [x] Done"
    
    # creating message dict from string then we can process that
    msg = eval(body)
    
    if isinstance(msg, dict):
        mh = MessageHandler()
        mh.processMsg(msg)
    else:
        print "unsupported message: Can't be processed"
        
    ch.basic_ack(delivery_tag = method.delivery_tag)
Esempio n. 2
0
def callback(ch, method, properties, body):
    print " [x] Received %r" % (body, )
    print " [x] Done"

    # creating message dict from string then we can process that
    msg = eval(body)

    if isinstance(msg, dict):
        mh = MessageHandler()
        mh.processMsg(msg)
    else:
        print "unsupported message: Can't be processed"

    ch.basic_ack(delivery_tag=method.delivery_tag)