User Tools

Site Tools


hpc:rabbitmq

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hpc:rabbitmq [2014/03/18 13:41]
jchilders
hpc:rabbitmq [2016/06/24 16:28] (current)
jchilders
Line 1: Line 1:
 ==== RabbitMQ Documentation ==== ==== RabbitMQ Documentation ====
  
-   * <html><a href="http://www.rabbitmq.com/documentation.html" target="_blank">RabbitMQ documentation</a></html> +   * <html><a href="http://www.rabbitmq.com/documentation.html" target="_blank">RabbitMQ</a></html> 
-   * <html><a href="http://pika.readthedocs.org/en/latest/intro.html" target="_blank">Pika</a> (used for RabbitMQ Python interface)+   * <html><a href="http://pika.readthedocs.org/en/latest/intro.html" target="_blank">Pika</a></html> (used for RabbitMQ Python interface) 
 + 
 +==== SSL Certificate Usage ==== 
 + 
 +   * Followed <html><a href="http://www.rabbitmq.com/ssl.html" target="_blank">RabbitMQ documentation</a></html> to produce SSL server/client certificates. 
 +   * Added this code to the RabbitMQ Server configuration file: 
 +<code python> 
 +
 +  {rabbit, [ 
 +     {ssl_listeners, [5671]}, 
 +     {ssl_options, [{cacertfile,"/path/to/testca/cacert.pem"}, 
 +                    {certfile,"/path/to/server/cert.pem"}, 
 +                    {keyfile,"/path/to/server/key.pem"}, 
 +                    {verify,verify_peer}, 
 +                    {fail_if_no_peer_cert,true}]} 
 +   ]} 
 +]. 
 +</code> 
 +   * Added this code to the RabbitMQ Client (via Pika) Setup: 
 +<code python> 
 +#!/usr/bin/env python 
 +import pika 
 +import sys,ssl 
 + 
 +# Setup our ssl options 
 +ssl_options = {"ca_certs": "/path/to/testca/cacert.pem", 
 +               "certfile": "/path/to/client/cert.pem", 
 +               "keyfile": "/path/to/client/key.pem", 
 +               "cert_reqs": ssl.CERT_REQUIRED, 
 +              } 
 + 
 +connection = pika.BlockingConnection(pika.ConnectionParameters(host='servername.com',port=5671,ssl=True,ssl_options=ssl_options)) 
 +channel = connection.channel() 
 + 
 +channel.queue_declare(queue='hello'
 + 
 +channel.basic_publish(exchange='', 
 +                      routing_key='hello', 
 +                      body='Hello World!'
 +print " [x] Sent 'Hello World!'" 
 + 
 +connection.close() 
 +</code> 
 + 
 + 
 +===== Errors ===== 
 + 
 +Make sure cacerts.pem is up to date. 
 +cat all /etc/grid-security/ceriticates/*.pem to cacerts.pem. 
 + 
hpc/rabbitmq.1395150065.txt.gz · Last modified: 2014/03/18 13:41 by jchilders