ConcurrentBetweenPartitionsSubscriber
faststream.kafka.subscriber.usecase.ConcurrentBetweenPartitionsSubscriber #
ConcurrentBetweenPartitionsSubscriber(
config: KafkaSubscriberConfig,
specification: SubscriberSpecification[Any, Any],
calls: CallsCollection[ConsumerRecord],
max_workers: int,
)
Bases: DefaultSubscriber
Source code in faststream/kafka/subscriber/usecase.py
parser instance-attribute #
parser = AioKafkaParser(
msg_class=KafkaMessage
if ack_first
else KafkaAckableMessage,
regex=reg,
)
start async #
Start the consumer subgroup.
Source code in faststream/kafka/subscriber/usecase.py
stop async #
Source code in faststream/kafka/subscriber/usecase.py
get_msg async #
get_msg(consumer: AIOKafkaConsumer) -> KafkaRawMessage
Source code in faststream/kafka/subscriber/usecase.py
add_call #
add_call(
*,
parser_: Optional[CustomCallable],
decoder_: Optional[CustomCallable],
dependencies_: Iterable[Dependant],
) -> Self
Source code in faststream/_internal/endpoint/subscriber/usecase.py
consume async #
Consume a message asynchronously.
Source code in faststream/_internal/endpoint/subscriber/usecase.py
process_message async #
process_message(msg: MsgType) -> Response
Execute all message processing stages.
Source code in faststream/_internal/endpoint/subscriber/usecase.py
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 | |
get_one async #
get_one(*, timeout: float = 5.0) -> KafkaMessage | None
Source code in faststream/kafka/subscriber/usecase.py
get_log_context #
get_log_context(
message: Optional[StreamMessage[ConsumerRecord]],
) -> dict[str, str]
Source code in faststream/kafka/subscriber/usecase.py
schema #
schema() -> dict[str, SubscriberSpec]
add_task #
add_task(
func: Callable[..., Coroutine[Any, Any, Any]],
func_args: tuple[Any, ...] | None = None,
func_kwargs: dict[str, Any] | None = None,
) -> Task[Any]
Source code in faststream/_internal/endpoint/subscriber/mixins.py
consume_one async #
build_log_context staticmethod #
build_log_context(
message: Optional[StreamMessage[Any]],
topic: str,
group_id: str | None = None,
) -> dict[str, str]