Skip to content

MockConfluentMessage

faststream.confluent.test.MockConfluentMessage #

MockConfluentMessage(raw_msg: bytes, topic: str, key: bytes, headers: List[Tuple[str, bytes]], offset: int, partition: int, timestamp_type: int, timestamp_ms: int, error: Optional[str] = None)
Source code in faststream/confluent/test.py
def __init__(
    self,
    raw_msg: bytes,
    topic: str,
    key: bytes,
    headers: List[Tuple[str, bytes]],
    offset: int,
    partition: int,
    timestamp_type: int,
    timestamp_ms: int,
    error: Optional[str] = None,
):
    self._raw_msg = raw_msg
    self._topic = topic
    self._key = key
    self._headers = headers
    self._error = error
    self._offset = offset
    self._partition = partition
    self._timestamp = (timestamp_type, timestamp_ms)

error #

error() -> Optional[str]
Source code in faststream/confluent/test.py
def error(self) -> Optional[str]:
    return self._error

headers #

headers() -> List[Tuple[str, bytes]]
Source code in faststream/confluent/test.py
def headers(self) -> List[Tuple[str, bytes]]:
    return self._headers

key #

key() -> bytes
Source code in faststream/confluent/test.py
def key(self) -> bytes:
    return self._key

len #

len() -> int
Source code in faststream/confluent/test.py
def len(self) -> int:
    return len(self._raw_msg)

offset #

offset() -> int
Source code in faststream/confluent/test.py
def offset(self) -> int:
    return self._offset

partition #

partition() -> int
Source code in faststream/confluent/test.py
def partition(self) -> int:
    return self._partition

timestamp #

timestamp() -> Tuple[int, int]
Source code in faststream/confluent/test.py
def timestamp(self) -> Tuple[int, int]:
    return self._timestamp

topic #

topic() -> str
Source code in faststream/confluent/test.py
def topic(self) -> str:
    return self._topic

value #

value() -> bytes
Source code in faststream/confluent/test.py
def value(self) -> bytes:
    return self._raw_msg