# Collection of code snippets by Arne Vajhøj 
# (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
import stomp

HOST = 'localhost'
PORT = 61613
UN = 'arne'
PW = 'topsecret'
QNAME = '/queue/TestQ'
PAYLOAD = "<data>\r\n    <id>123</id>\r\n    <name>ABC</name>\r\n</data>"

con = stomp.Connection([(HOST, PORT)])
con.start()
con.connect(UN, PW)
for i in range(3):
    con.send(QNAME, PAYLOAD, headers={ "amq-msg-type" : "text" })
con.disconnect()
