跳到主要内容
版本:Next

Context

Hierarchy

Index

Properties

consumer

consumer: Consumer

logger

logger: ILogger

optionalmessage

message?: any
@deprecated

please use ctx.payload instead

optionalpartition

partition?: any
@deprecated

please use ctx.payload instead

payload

payload: EachMessagePayload | EachBatchPayload

requestContext

requestContext: IMidwayContainer

Custom properties.

startTime

startTime: number

optionaltopic

topic?: any
@deprecated

please use ctx.payload instead

Methods

optionalcommitOffsets

  • commitOffsets(data: any): void
  • @deprecated

    please use ctx.consumer.commitOffsets instead

getApp

  • getApp(): IMidwayBaseApplication<Context>
  • Get current related application instance.

getAttr

  • getAttr<T>(key: string): T
  • Get value from app attribute map


    Type parameters

    • T

getLogger

  • getLogger(name?: string): ILogger

setAttr

  • setAttr(key: string, value: any): any
  • Set value to app attribute map