add subscriber coordinator
This commit is contained in:
@@ -11,9 +11,14 @@ import (
|
||||
|
||||
func (sub *TopicSubscriber) Subscribe() error {
|
||||
util.RetryUntil("subscribe", func() error {
|
||||
// ask balancer for brokers of the topic
|
||||
if err := sub.doLookup(sub.bootstrapBroker); err != nil {
|
||||
return fmt.Errorf("lookup topic %s/%s: %v", sub.ContentConfig.Namespace, sub.ContentConfig.Topic, err)
|
||||
}
|
||||
// treat the first broker as the topic leader
|
||||
// connect to the leader broker
|
||||
|
||||
// subscribe to the topic
|
||||
if err := sub.doProcess(); err != nil {
|
||||
return fmt.Errorf("subscribe topic %s/%s: %v", sub.ContentConfig.Namespace, sub.ContentConfig.Topic, err)
|
||||
}
|
||||
|
||||
@@ -6,11 +6,13 @@ import (
|
||||
)
|
||||
|
||||
type SubscriberConfiguration struct {
|
||||
ClientId string
|
||||
GroupId string
|
||||
GroupInstanceId string
|
||||
BootstrapServers []string
|
||||
GrpcDialOption grpc.DialOption
|
||||
ClientId string
|
||||
GroupId string
|
||||
GroupInstanceId string
|
||||
GroupMinimumPeers int32
|
||||
GroupMaximumPeers int32
|
||||
BootstrapServers []string
|
||||
GrpcDialOption grpc.DialOption
|
||||
}
|
||||
|
||||
type ContentConfiguration struct {
|
||||
|
||||
Reference in New Issue
Block a user