Browse Source

logs

mq-subscribe
chrislu 9 months ago
parent
commit
0d55bddc75
  1. 2
      weed/mq/broker/broker_grpc_pub.go
  2. 1
      weed/mq/topic/local_partition.go

2
weed/mq/broker/broker_grpc_pub.go

@ -106,11 +106,9 @@ func (b *MessageQueueBroker) PublishMessage(stream mq_pb.SeaweedMessaging_Publis
clientName := fmt.Sprintf("%v-%4d/%s/%v", findClientAddress(stream.Context()), rand.Intn(10000), initMessage.Topic, initMessage.Partition)
localTopicPartition.Publishers.AddPublisher(clientName, topic.NewLocalPublisher())
var ackSequence int64
defer func() {
// remove the publisher
localTopicPartition.Publishers.RemovePublisher(clientName)
glog.V(0).Infof("topic %v partition %v published %d messges Publisher:%d Subscriber:%d", initMessage.Topic, initMessage.Partition, ackSequence, localTopicPartition.Publishers.Size(), localTopicPartition.Subscribers.Size())
if localTopicPartition.MaybeShutdownLocalPartition() {
b.localTopicManager.RemoveTopicPartition(t, p)
glog.V(0).Infof("Removed local topic %v partition %v", initMessage.Topic, initMessage.Partition)

1
weed/mq/topic/local_partition.go

@ -204,6 +204,7 @@ func (p *LocalPartition) MaybeShutdownLocalPartition() (hasShutdown bool) {
hasShutdown = true
}
glog.V(0).Infof("local partition %v Publisher:%d Subscriber:%d follower:%s shutdown %v", p.Partition, p.Publishers.Size(), p.Subscribers.Size(), p.follower, hasShutdown)
return
}

Loading…
Cancel
Save