| 12 | |
| 13 | @dataclass |
| 14 | class MessageContext: |
| 15 | action: str |
| 16 | payload: dict[str, Any] |
| 17 | headers: dict[str, Any] |
| 18 | routing_key: str |
| 19 | queue_name: str |
| 20 | delivery_tag: int |
| 21 | redelivered: bool |
| 22 | timestamp: datetime | None = None |
| 23 | |
| 24 | def to_str(self) -> str: |
| 25 | return f"Action: {self.action}, Payload: {self.payload}" |