We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e7e9887 commit 981901aCopy full SHA for 981901a
test_send_log.py
@@ -1,15 +1,19 @@
1
+import os
2
import asyncio
3
import json
4
from datetime import datetime
5
6
import aio_pika
7
+import dotenv
8
+
9
+dotenv.load_dotenv() # Load environment variables from .env file
10
11
12
async def send_test_log():
13
"""Send a test log to RabbitMQ."""
14
# Update with your credentials
15
connection = await aio_pika.connect_robust(
- "amqp://guest:guest@localhost:5672/"
16
+ f"amqp://{os.getenv('RABBITMQ_USER')}:{os.getenv('RABBITMQ_PASSWORD')}@localhost:{os.getenv('RABBITMQ_PORT')}/"
17
)
18
19
async with connection:
0 commit comments