Skip to content

Commit 92ff6e6

Browse files
committed
fix: update message logging format and rename publish function for clarity
1 parent ddca844 commit 92ff6e6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/modules/transporter/rabbitmq.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def callback(ch, method, properties, body):
3737

3838
@queue_listener("hello-python")
3939
def process_message(msg):
40-
print(f"[x] Received: {msg}")
40+
print(f"[rabbitmq][hello-python] Received: {msg}")
4141

4242

4343
@queue_listener("test")
@@ -47,7 +47,7 @@ def test_queue_listener(msg):
4747

4848

4949
# publish a message to the queue
50-
def publish_message(queue_name, message):
50+
def add_to_queue(queue_name, message):
5151
connection = pika.BlockingConnection(parameters)
5252
channel = connection.channel()
5353
# channel.queue_declare(queue=queue_name, durable=True)
@@ -61,4 +61,4 @@ def publish_message(queue_name, message):
6161
)
6262
print(f"[x] Sent: {message}")
6363

64-
publish_message("hello-python", "RabbitMQ is running!")
64+
add_to_queue("hello-python", "RabbitMQ is running!")

0 commit comments

Comments
 (0)