Skip to content

StreamMessage

faststream.broker.message.StreamMessage #

Bases: ABCStreamMessage[Msg]

body instance-attribute #

body: Union[bytes, Any]

content_type class-attribute instance-attribute #

content_type: Optional[str] = None

correlation_id class-attribute instance-attribute #

correlation_id: str = field(
    default_factory=lambda: str(uuid4())
)

decoded_body class-attribute instance-attribute #

decoded_body: Optional[DecodedMessage] = None

headers class-attribute instance-attribute #

headers: AnyDict = field(default_factory=dict)

message_id class-attribute instance-attribute #

message_id: str = field(
    default_factory=lambda: str(uuid4())
)

path class-attribute instance-attribute #

path: AnyDict = field(default_factory=dict)

processed class-attribute instance-attribute #

processed: bool = False

raw_message instance-attribute #

raw_message: Msg

reply_to class-attribute instance-attribute #

reply_to: str = ''

ack abstractmethod async #

ack(**kwargs: Any) -> None

Acknowledge method.

PARAMETER DESCRIPTION
**kwargs

Additional keyword arguments

TYPE: Any DEFAULT: {}

RAISES DESCRIPTION
NotImplementedError

If the method is not implemented.

Note

The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)

Source code in faststream/broker/message.py
@abstractmethod
async def ack(self, **kwargs: Any) -> None:
    """Acknowledge method.

    Args:
        **kwargs: Additional keyword arguments

    Raises:
        NotImplementedError: If the method is not implemented.
    !!! note

        The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)
    """
    raise NotImplementedError()

nack abstractmethod async #

nack(**kwargs: Any) -> None

A function to handle a nack.

PARAMETER DESCRIPTION
**kwargs

Additional arguments

TYPE: Any DEFAULT: {}

RETURNS DESCRIPTION
None

None

RAISES DESCRIPTION
NotImplementedError

If the function is not implemented.

Note

The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)

Source code in faststream/broker/message.py
@abstractmethod
async def nack(self, **kwargs: Any) -> None:
    """A function to handle a nack.

    Args:
        **kwargs: Additional arguments

    Returns:
        None

    Raises:
        NotImplementedError: If the function is not implemented.
    !!! note

        The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)
    """
    raise NotImplementedError()

reject abstractmethod async #

reject(**kwargs: Any) -> None

Rejects the operation.

PARAMETER DESCRIPTION
**kwargs

Additional keyword arguments

TYPE: Any DEFAULT: {}

RETURNS DESCRIPTION
None

None

RAISES DESCRIPTION
NotImplementedError

Always raises NotImplementedError

Note

The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)

Source code in faststream/broker/message.py
@abstractmethod
async def reject(self, **kwargs: Any) -> None:
    """Rejects the operation.

    Args:
        **kwargs: Additional keyword arguments

    Returns:
        None

    Raises:
        NotImplementedError: Always raises NotImplementedError
    !!! note

        The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)
    """
    raise NotImplementedError()

Last update: 2023-11-13