commons-go/config/external/kafka.go
crusader cc2bef72c8 ing
2018-05-08 12:05:07 +09:00

39 lines
2.4 KiB
Go

package external
import "time"
type Kafka struct {
Consumers map[string]*KafkaConsumer `json:"consumers" yaml:"consumers" toml:"consumers"`
Producers map[string]*KafkaProducer `json:"producers" yaml:"producers" toml:"producers"`
}
type KafkaProducer struct {
Brokers []string `json:"brokers" yaml:"brokers" toml:"brokers"`
Topic string `json:"topic" yaml:"topic" toml:"topic"`
MaxAttempts int `json:"maxAttempts" yaml:"maxAttempts" toml:"maxAttempts"`
QueueCapacity int `json:"queueCapacity" yaml:"queueCapacity" toml:"queueCapacity"`
BatchSize int `json:"batchSize" yaml:"batchSize" toml:"batchSize"`
BatchTimeout time.Duration `json:"batchTimeout" yaml:"batchTimeout" toml:"batchTimeout"`
ReadTimeout time.Duration `json:"readTimeout" yaml:"readTimeout" toml:"readTimeout"`
WriteTimeout time.Duration `json:"writeTimeout" yaml:"writeTimeout" toml:"writeTimeout"`
RebalanceInterval time.Duration `json:"rebalanceInterval" yaml:"rebalanceInterval" toml:"rebalanceInterval"`
RequiredAcks int `json:"requiredAcks" yaml:"requiredAcks" toml:"requiredAcks"`
Async bool `json:"async" yaml:"async" toml:"async"`
}
type KafkaConsumer struct {
Brokers []string `json:"brokers" yaml:"brokers" toml:"brokers"`
GroupID string `json:"groupID" yaml:"groupID" toml:"groupID"`
Topic string `json:"topic" yaml:"topic" toml:"topic"`
QueueCapacity int `json:"queueCapacity" yaml:"queueCapacity" toml:"queueCapacity"`
MinBytes int `json:"minBytes" yaml:"minBytes" toml:"minBytes"`
MaxBytes int `json:"maxBytes" yaml:"maxBytes" toml:"maxBytes"`
MaxWait time.Duration `json:"maxWait" yaml:"maxWait" toml:"maxWait"`
ReadLagInterval time.Duration `json:"readLagInterval" yaml:"readLagInterval" toml:"readLagInterval"`
HeartbeatInterval time.Duration `json:"heartbeatInterval" yaml:"heartbeatInterval" toml:"heartbeatInterval"`
CommitInterval time.Duration `json:"commitInterval" yaml:"commitInterval" toml:"commitInterval"`
SessionTimeout time.Duration `json:"sessionTimeout" yaml:"sessionTimeout" toml:"sessionTimeout"`
RebalanceTimeout time.Duration `json:"rebalanceTimeout" yaml:"rebalanceTimeout" toml:"rebalanceTimeout"`
RetentionTime time.Duration `json:"retentionTime" yaml:"retentionTime" toml:"retentionTime"`
}