Browse Source

rename

mq-subscribe
chrislu 10 months ago
parent
commit
f67c8309d8
  1. 6
      weed/mq/broker/broker_grpc_pub.go
  2. 4
      weed/mq/topic/local_partition.go

6
weed/mq/broker/broker_grpc_pub.go

@ -68,13 +68,13 @@ func (b *MessageQueueBroker) PublishMessage(stream mq_pb.SeaweedMessaging_Publis
if localTopicPartition.FollowerStream == nil && len(initMessage.FollowerBrokers) > 0 {
follower := initMessage.FollowerBrokers[0]
ctx := stream.Context()
localTopicPartition.GrpcConnection, err = pb.GrpcDial(ctx, follower, true, b.grpcDialOption)
localTopicPartition.FollowerGrpcConnection, err = pb.GrpcDial(ctx, follower, true, b.grpcDialOption)
if err != nil {
response.Error = fmt.Sprintf("fail to dial %s: %v", follower, err)
glog.Errorf("fail to dial %s: %v", follower, err)
return stream.Send(response)
}
followerClient := mq_pb.NewSeaweedMessagingClient(localTopicPartition.GrpcConnection)
followerClient := mq_pb.NewSeaweedMessagingClient(localTopicPartition.FollowerGrpcConnection)
localTopicPartition.FollowerStream, err = followerClient.PublishFollowMe(ctx)
if err != nil {
response.Error = fmt.Sprintf("fail to create publish client: %v", err)
@ -136,7 +136,7 @@ func (b *MessageQueueBroker) PublishMessage(stream mq_pb.SeaweedMessaging_Publis
glog.Errorf("Error closing follower stream: %v", followErr)
}
println("closing grpcConnection to follower")
localTopicPartition.GrpcConnection.Close()
localTopicPartition.FollowerGrpcConnection.Close()
}
b.localTopicManager.RemoveTopicPartition(t, p)
glog.V(0).Infof("Removed local topic %v partition %v", initMessage.Topic, initMessage.Partition)

4
weed/mq/topic/local_partition.go

@ -28,8 +28,8 @@ type LocalPartition struct {
Subscribers *LocalPartitionSubscribers
FollowerId int32
FollowerStream mq_pb.SeaweedMessaging_PublishFollowMeClient
GrpcConnection *grpc.ClientConn
FollowerStream mq_pb.SeaweedMessaging_PublishFollowMeClient
FollowerGrpcConnection *grpc.ClientConn
}
var TIME_FORMAT = "2006-01-02-15-04-05"

Loading…
Cancel
Save