Any data placed into connection URIs or transmitted over the network (e.g., JSON payloads/headers) must be encoded/serialized according to the protocol’s rules.

Example:

from uuid import uuid4
from urllib.parse import quote

user = quote('alice+team', safe='')
password = quote('p@ss:word', safe='')
uri = f"amqp://{user}:{password}@host/vhost"

# For JSON/headers:
monitoring_id = uuid4().hex  # not uuid4() directly
headers = {"monitoring_id": monitoring_id}