From 92e7866cbd474de5f7af430ed8b602303cb9226b Mon Sep 17 00:00:00 2001 From: Bo-Chun Louis Chen <louistw@uab.edu> Date: Thu, 20 Feb 2020 20:38:05 +0000 Subject: [PATCH] Update README --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 45d4efb..8aaac09 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,29 @@ This repo keeps different rabbitmq agents that help in account creation on OHPC system. -It has 2 branches ```develop``` and ```production``` , that houses agents based on where they are launched +It has 2 branches ```develop``` and ```production``` , that house agents based on where they are launched + +## Using RCRMQ class + +- First, rename `rabbitmq_config.py.example` to `rabbitmq_config.py` + +- Modify config file, at least the `Password` needs to be your own passwod + +- In your code: + +``` +# import the class +from rc_rmq import RCRMQ + +# instantiate an instance +rc_rmq = RCRMQ({'exchange': 'RegUsr'}) + +# publish a message to message queue +rc_rmq.publish_msg({ + 'routing_key': 'your_key', + 'msg': { + 'type': 'warning', + 'content': 'this is warning' + } +}) +``` -- GitLab