messaging

package
v0.3.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2018 License: MIT Imports: 10 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	NewConsumer(topicName, consumerName string, concurrency int) (kafka.Consumer, error)
	NewProducer(topicName string) (Producer, error)
}

Client is the interface used to abstract out interaction with messaging system for replication

type ClusterConfig

type ClusterConfig struct {
	Brokers []string `yaml:"brokers"`
}

ClusterConfig describes the configuration for a single Kafka cluster

type KafkaConfig

type KafkaConfig struct {
	Clusters map[string]ClusterConfig `yaml:"clusters"`
	Topics   map[string]TopicConfig   `yaml:"topics"`
}

KafkaConfig describes the configuration needed to connect to all kafka clusters

func (*KafkaConfig) NewKafkaClient

func (k *KafkaConfig) NewKafkaClient(zLogger *zap.Logger, logger bark.Logger, metricScope tally.Scope) Client

NewKafkaClient is used to create an instance of KafkaClient

type Producer

type Producer interface {
	Publish(msg *replicator.ReplicationTask) error
	PublishBatch(msgs []*replicator.ReplicationTask) error
	Close() error
}

Producer is the interface used to send replication tasks to other clusters through replicator

func NewKafkaProducer

func NewKafkaProducer(topic string, producer sarama.SyncProducer, logger bark.Logger) Producer

NewKafkaProducer is used to create the Kafka based producer implementation

type TopicConfig

type TopicConfig struct {
	Cluster string `yaml:"cluster"`
}

TopicConfig describes the mapping from topic to Kafka cluster

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL