kafka.go 341 B

12345678910111213141516171819
  1. package service
  2. import (
  3. "github.com/confluentinc/confluent-kafka-go/v2/kafka"
  4. )
  5. type ConsumerHandler func(*kafka.Message) error
  6. type Consumer interface {
  7. Service
  8. Subscribe([]string, chan uint32) (chan *kafka.Message, error)
  9. RegisterHandlers(...ConsumerHandler)
  10. }
  11. type Producer interface {
  12. Service
  13. Produce(*kafka.Message) error
  14. }