Documentation ¶
Index ¶
- Constants
- func DefaultConfig() *config
- type Component
- func (cmp *Component) Consumer() *ekafka.Consumer
- func (cmp *Component) ConsumerGroup() *ekafka.ConsumerGroup
- func (cmp *Component) GracefulStop(ctx context.Context) error
- func (cmp *Component) Info() *server.ServiceInfo
- func (cmp *Component) Init() error
- func (cmp *Component) Name() string
- func (cmp *Component) OnConsumeEachMessage(handler OnConsumeEachMessageHandler) error
- func (cmp *Component) OnConsumerGroupStart(handler OnConsumerGroupStartHandler) error
- func (cmp *Component) OnEachMessage(consumptionErrors chan<- error, handler OnEachMessageHandler) error
- func (cmp *Component) OnStart(handler OnStartHandler) error
- func (cmp *Component) PackageName() string
- func (cmp *Component) Start() error
- func (cmp *Component) Stop() error
- type Container
- type OnConsumeEachMessageHandler
- type OnConsumerGroupStartHandler
- type OnEachMessageHandler
- type OnStartHandler
- type Option
Constants ¶
const PackageName = "component.ekafka.consumerserver"
PackageName is the name of this component.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Component ¶
Component starts an Ego server for message consuming.
func NewConsumerServerComponent ¶
func NewConsumerServerComponent(name string, config *config, ekafkaComponent *ekafka.Component, logger *elog.Component) *Component
NewConsumerServerComponent creates a new server instance.
func (*Component) ConsumerGroup ¶
func (cmp *Component) ConsumerGroup() *ekafka.ConsumerGroup
ConsumerGroup returns the default ConsumerGroup.
func (*Component) GracefulStop ¶
GracefulStop stops the server.
func (*Component) Info ¶
func (cmp *Component) Info() *server.ServiceInfo
Info returns server info, used by governor and consumer balancer.
func (*Component) OnConsumeEachMessage ¶ added in v1.0.2
func (cmp *Component) OnConsumeEachMessage(handler OnConsumeEachMessageHandler) error
OnConsumeEachMessage register a handler for each message. When the handler returns an error, the message will be retried if the error is ErrRecoverableError else the message will not be committed.
func (*Component) OnConsumerGroupStart ¶
func (cmp *Component) OnConsumerGroupStart(handler OnConsumerGroupStartHandler) error
OnConsumerGroupStart ...
func (*Component) OnEachMessage ¶
func (cmp *Component) OnEachMessage(consumptionErrors chan<- error, handler OnEachMessageHandler) error
OnEachMessage ... Deprecated: use OnConsumeEachMessage instead.
func (*Component) PackageName ¶
PackageName returns the package name.
type OnConsumeEachMessageHandler ¶ added in v1.0.3
OnConsumeEachMessageHandler ...
type OnConsumerGroupStartHandler ¶
type OnConsumerGroupStartHandler = func(ctx context.Context, consumerGroup *ekafka.ConsumerGroup) error
OnConsumerGroupStartHandler ...
type OnEachMessageHandler ¶
OnEachMessageHandler ...
type OnStartHandler ¶
OnStartHandler ...