mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-25 19:22:46 +08:00
test
This commit is contained in:
parent
f373669f02
commit
d36f4cf6f8
@ -98,23 +98,23 @@ func (OfflineHistoryConsumerHandler) Setup(_ sarama.ConsumerGroupSession) error
|
|||||||
func (OfflineHistoryConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil }
|
func (OfflineHistoryConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil }
|
||||||
func (mc *OfflineHistoryConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession,
|
func (mc *OfflineHistoryConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession,
|
||||||
claim sarama.ConsumerGroupClaim) error { // a instance in the consumer group
|
claim sarama.ConsumerGroupClaim) error { // a instance in the consumer group
|
||||||
log.NewDebug("", "offline new session msg come", claim.HighWaterMarkOffset(), claim.Topic(), claim.Partition())
|
//log.NewDebug("", "offline new session msg come", claim.HighWaterMarkOffset(), claim.Topic(), claim.Partition())
|
||||||
for msg := range claim.Messages() {
|
//for msg := range claim.Messages() {
|
||||||
log.NewDebug("", "kafka get info to delay mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "offline")
|
// log.NewDebug("", "kafka get info to delay mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "offline")
|
||||||
//mc.msgHandle[msg.Topic](msg.Value, string(msg.Key))
|
// //mc.msgHandle[msg.Topic](msg.Value, string(msg.Key))
|
||||||
}
|
|
||||||
//select {
|
|
||||||
//case cmd := <-mc.cmdCh:
|
|
||||||
// if cmd.Cmd == OnlineTopicVacancy {
|
|
||||||
// for msg := range claim.Messages() {
|
|
||||||
// if GetOnlineTopicStatus() == OnlineTopicVacancy {
|
|
||||||
// log.NewDebug("", "kafka get info to mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value))
|
|
||||||
// mc.msgHandle[msg.Topic](msg.Value, string(msg.Key))
|
|
||||||
// sess.MarkMessage(msg, "")
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//}
|
//}
|
||||||
|
select {
|
||||||
|
case cmd := <-mc.cmdCh:
|
||||||
|
if cmd.Cmd == OnlineTopicVacancy {
|
||||||
|
for msg := range claim.Messages() {
|
||||||
|
if GetOnlineTopicStatus() == OnlineTopicVacancy {
|
||||||
|
log.NewDebug("", "kafka get info to mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value))
|
||||||
|
mc.msgHandle[msg.Topic](msg.Value, string(msg.Key))
|
||||||
|
sess.MarkMessage(msg, "")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -134,9 +134,9 @@ func (OnlineHistoryConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error
|
|||||||
func (och *OnlineHistoryConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession,
|
func (och *OnlineHistoryConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession,
|
||||||
claim sarama.ConsumerGroupClaim) error { // a instance in the consumer group
|
claim sarama.ConsumerGroupClaim) error { // a instance in the consumer group
|
||||||
log.NewDebug("", "online new session msg come", claim.HighWaterMarkOffset(), claim.Topic(), claim.Partition())
|
log.NewDebug("", "online new session msg come", claim.HighWaterMarkOffset(), claim.Topic(), claim.Partition())
|
||||||
|
for msg := range claim.Messages() {
|
||||||
och.TriggerCmd(OnlineTopicBusy)
|
och.TriggerCmd(OnlineTopicBusy)
|
||||||
SetOnlineTopicStatus(OnlineTopicBusy)
|
SetOnlineTopicStatus(OnlineTopicBusy)
|
||||||
for msg := range claim.Messages() {
|
|
||||||
log.NewDebug("", "kafka get info to mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "online")
|
log.NewDebug("", "kafka get info to mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "online")
|
||||||
och.msgHandle[msg.Topic](msg.Value, string(msg.Key))
|
och.msgHandle[msg.Topic](msg.Value, string(msg.Key))
|
||||||
sess.MarkMessage(msg, "")
|
sess.MarkMessage(msg, "")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user