Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var KafkaClient *cluster.Client
KafkaClient holds kafka connection details to be used by consumers and producers
Functions ¶
func Init ¶
func Init()
Init configures and starts our kafka client (used to create consumers and producers)
func LaunchConsumer ¶
func LaunchConsumer()
LaunchConsumer creates a Kafka Consumer that listens for incoming messages
func LaunchProducer ¶
func LaunchProducer()
LaunchProducer creates a Kafka Producer that translates outbound messages
Types ¶
type EventConsumer ¶
EventConsumer is a custom struct that encapsulates cluster's Consumer this is for mockability and result tracking during testing
var Consumer *EventConsumer
Consumer will be our runtime object for consuming messages
func (*EventConsumer) Init ¶
func (s *EventConsumer) Init() (err error)
Init initializes our ClusterConsumer to consume our configured topics
func (*EventConsumer) Listen ¶
func (s *EventConsumer) Listen()
Listen will be in charge of commiting offsets reporting errors and calling relevant controllers
type EventProducer ¶
type EventProducer struct { AsyncProducer sarama.AsyncProducer Successes int64 Errors int64 Topic string }
EventProducer is a custom struct that encapsulates sarama's Producer this is for mockability and result tracking during testing
var Producer *EventProducer
Producer will be our runtime object for producing messages
func (*EventProducer) HandleIncoming ¶
func (s *EventProducer) HandleIncoming()
HandleIncoming counts and reports both errors and successes
func (*EventProducer) Init ¶
func (s *EventProducer) Init() (err error)
Init initializes out AsyncProducer