Here is a sample of a consumer and producer example for RabbitMQ. The steps are Download ErlangDownload Rabbit MQ ServerDownload Rabbit MQ Java client jarsCompile and run the below two class and you are done. This sample create a Durable Exchange, Queue and a Message. You will have to start the consumer first before you start the for the first time.
I have a thumbnail generator that launches multiple processes and the correct way to shut it down is to send kill -HUP to the parent process. To automate I had to write a pid file from python, it was a piece of cake
def writePidFile():
pid = str(os.getpid())
f = open('thumbnail_rabbit_consumer.pid', 'w')
f.write(pid)
f.close()
Comments
Post a Comment