Python service to service communication over rabbitmq ephemeral queues
Project description
Py S2S
This is a simple publish and subscribe for a response over RabbitMQ. This is only half of two parts needed for "http over rabbit" intended for service to service communication.
notice
This is an asyncio library that uses aio-pika.
example
async def run():
conn = RabbitConfig(
host='localhost',
port=5672,
username='guest',
password='guest',
exchange='/',
queue_name='my_queue' # This is a prefix, it will append a random string to the end of this.
)
c = Service2Service(service_name='Test Service', config=conn)
headers = {
'authorization': 'Bearer XX',
'content-type': 'application/json'
}
r = await c.request('accounts.load', dict(test=True, name='bob'), headers=headers)
print(r) # Returns a `S2S GenericResponse` dataclass
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
py-s2s-22.2.28.tar.gz
(8.3 kB
view details)
Built Distribution
File details
Details for the file py-s2s-22.2.28.tar.gz
.
File metadata
- Download URL: py-s2s-22.2.28.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.10.2 Darwin/21.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78fb61a5cc826b52b58f4259a9d95ee2cdcda2634a755001602fe4dba49e51ce |
|
MD5 | 9250f356048886a13c2e539281201dd7 |
|
BLAKE2b-256 | 50ff6dd3e5c6e2b9378b98dc9ec20527cf8109edba32c8128635d23072ca3c6a |
File details
Details for the file py_s2s-22.2.28-py3-none-any.whl
.
File metadata
- Download URL: py_s2s-22.2.28-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.10.2 Darwin/21.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b4a46dc1d6cf8750a2886a2c3e66034fd0eb6c73cfab24361c8aeaadf96c850 |
|
MD5 | 508e87a1fa34710ae4bd51ddd004e3e0 |
|
BLAKE2b-256 | ade0272dcd020f3d0394cb832e47f71e736da532b10adb7d215204079e6cd704 |