Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import qpid
- import sys
- import os
- from qpid.util import connect
- from qpid.connection import Connection
- from qpid.datatypes import Message
- from qpid.datatypes import uuid4
- from qpid.queue import Empty
- host = "127.0.0.1"
- port = 5672
- user = "guest"
- password = "guest"
- socket = connect(host, port)
- connection = Connection (sock = socket, username = user, password = password)
- connection.start()
- session = connection.session(str(uuid4()))
- props = session.delivery_properties(routing_key = "routing_key")
- session.message_transfer(destination = "amq.direct", message = Message(props, "Teste do MRG Messaging"))
- session.close(timeout = 10)
- print "Mensagem enviada com sucesso!"
Add Comment
Please, Sign In to add comment