Skip to main content

MessageEntry (Python)

When receive(), fetch(), or listen() methods return a payload, they return a MessageEntry object. If no payload is available, they return None.


Attributes​

AttributeTypeDescription
sourcestrIdentifier of the original sending application client
destinationstrIdentifier of the intended receiving application client
payloadbytesThe raw payload bytes
payload_sizeintThe original size of the payload in bytes

Example​

entry = nsb_conn.receive()
if entry:
print(f"Source: {entry.source}")
print(f"Destination: {entry.destination}")
print(f"Payload size: {entry.payload_size}")
print(f"Payload: {entry.payload}")

Go Deeper​