kafka.go 384 B

123456789101112131415161718192021222324
  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. SetPause(bool) error
  9. Paused() bool
  10. Subscribe([]string, chan *kafka.Message) error
  11. Subscribed() bool
  12. RegisterHandlers(...ConsumerHandler)
  13. }
  14. type Producer interface {
  15. Service
  16. Produce(*kafka.Message) error
  17. }