Documentation ¶
Index ¶
- type Consumer
- func (c *Consumer) Cleanup(sarama.ConsumerGroupSession) error
- func (c *Consumer) Close() error
- func (c *Consumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
- func (c *Consumer) Setup(sarama.ConsumerGroupSession) error
- func (c *Consumer) Start(topics string, handlers *EventHandlers) error
- type EventHandler
- type EventHandlers
- type Producer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
Consumer represents a Sarama consumer group consumer
func NewConsumer ¶
func NewConsumer( brokers string, group string, version string, logger log.Logger, nr newrelic.Application, handler func(error), ) (c *Consumer, err error)
NewConsumer creates new kakfa consumer, and wires all provided middlewares
func (*Consumer) Cleanup ¶
func (c *Consumer) Cleanup(sarama.ConsumerGroupSession) error
Cleanup is run at the end of a session, once all ConsumeClaim goroutines have exited
func (*Consumer) ConsumeClaim ¶
func (c *Consumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
ConsumeClaim must start a consumer loop of ConsumerGroupClaim's Messages().
type EventHandler ¶
type EventHandler func(message *sarama.ConsumerMessage) (err error)
EventHandler repersents an event handling logic for specific topic / key
type EventHandlers ¶
type EventHandlers map[string]EventHandler
EventHandlers is a hash object with "topic_key" => event handler
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
Producer provides means of emitting events to Kafka
func NewProducer ¶
NewProducer get a pointer to an instance of a producer so messages can be sent
Click to show internal directories.
Click to hide internal directories.