blob: f6ae0f78ace4aec2321716eca1f33bc0851bb509 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
import os
def attempt_automatically_finding_the_ip_of_rmq():
try:
import docker
client = docker.from_env()
containers = client.containers.get('snekbox_pdrmq_1')
HOST = list(containers.attrs.get('NetworkSettings').get('Networks').values())[0]['IPAddress']
return HOST
except Exception:
return '172.17.0.2'
USERNAME = 'guest'
PASSWORD = 'guest'
HOST = os.environ.get('RMQ_HOST', attempt_automatically_finding_the_ip_of_rmq())
PORT = 5672
EXCHANGE_TYPE = 'direct'
QUEUE = 'input'
EXCHANGE = QUEUE
ROUTING_KEY = QUEUE
RETURN_QUEUE = 'return'
RETURN_EXCHANGE = RETURN_QUEUE
RETURN_ROUTING_KEY = RETURN_QUEUE
|