Skip to content

MockConfluentMessage

faststream.confluent.testing.MockConfluentMessage #

MockConfluentMessage(
    raw_msg,
    topic,
    key,
    headers,
    offset,
    partition,
    timestamp_type,
    timestamp_ms,
    error=None,
)
Source code in faststream/confluent/testing.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)

len #

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

error #

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

headers #

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

key #

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

offset #

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

partition #

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

timestamp #

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

topic #

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

value #

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