source: trunk/Monitoring/test/librabbitmq-python/test1/client.sh @ 854

Last change on this file since 854 was 854, checked in by jripsl, 11 years ago

add JSON deserialization, mail notification, logging.

  • Property svn:executable set to *
File size: 556 bytes
Line 
1from amqplib import client_0_8 as amqp
2
3# connect to server
4lConnection = amqp.Connection(host="localhost:5672", userid="guest", password="guest", virtual_host="/", insist=False)
5lChannel = lConnection.channel()
6
7# Create a message
8lMessage = amqp.Message("Test message!")
9
10# Send message as persistant.  This means it will survive a reboot.
11lMessage.properties["delivery_mode"] = 2
12
13# publish the message on the exchange
14lChannel.basic_publish(lMessage, exchange="myExchange", routing_key="Test")
15
16# Close connection
17lChannel.close()
18lConnection.close()
Note: See TracBrowser for help on using the repository browser.