Skip to content

Commit f391ae5

Browse files
committed
Initial Commit
0 parents  commit f391ae5

13 files changed

Lines changed: 128 additions & 0 deletions

API/config.ctl

15.8 KB
Binary file not shown.

API/connect.vi

28 KB
Binary file not shown.

API/disconnect.vi

19 KB
Binary file not shown.

API/openQueue.vi

25.2 KB
Binary file not shown.
1.15 KB
Binary file not shown.

API/python/rabbitmq/sender.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
import ssl
3+
import pika
4+
import platform
5+
6+
_connection = None
7+
8+
9+
def CreateConnection(host, port, virtual_host, username, password):
10+
connection = pika.BlockingConnection(
11+
pika.ConnectionParameters(
12+
port=port,
13+
virtual_host=virtual_host,
14+
host=host,
15+
credentials=pika.PlainCredentials(username=username, password=password),
16+
ssl_options=pika.SSLOptions(context=ssl.SSLContext(), server_hostname=platform.node())
17+
),
18+
)
19+
channel = connection.channel()
20+
global _connection
21+
if _connection:
22+
raise KeyError
23+
_connection = channel
24+
25+
26+
def OpenQueue(queue_name):
27+
global _connection
28+
_connection.queue_declare(queue=queue_name)
29+
30+
31+
def SendOnQueue(queue_name, message):
32+
global _connection
33+
_connection.basic_publish(
34+
exchange='', routing_key=queue_name, body=message)
35+
36+
37+
if __name__ == '__main__':
38+
CreateConnection(port=5673, username='tmri4', password='tmri4', virtual_host='tmri4', host='localhost')
39+
OpenQueue('test_python')
40+
SendOnQueue('test_python', 'Python Test Message')

API/send.vi

26.4 KB
Binary file not shown.

API/session.ctl

15.5 KB
Binary file not shown.

RabbitMQPythonScaffold.vi

10.8 KB
Binary file not shown.

rabbitmq.aliases

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[My Computer]
2+
My Computer = "192.168.224.1"
3+

0 commit comments

Comments
 (0)