mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-17 15:29:03 +08:00
panic output detail info
This commit is contained in:
@@ -20,14 +20,14 @@ func NewKafkaConsumer(addr []string, topic string) *Consumer {
|
||||
|
||||
consumer, err := sarama.NewConsumer(p.addr, nil)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
panic(err.Error())
|
||||
return nil
|
||||
}
|
||||
p.Consumer = consumer
|
||||
|
||||
partitionList, err := consumer.Partitions(p.Topic)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
panic(err.Error())
|
||||
return nil
|
||||
}
|
||||
p.PartitionList = partitionList
|
||||
|
||||
@@ -30,11 +30,11 @@ func NewMConsumerGroup(consumerConfig *MConsumerGroupConfig, topics, addr []stri
|
||||
config.Consumer.Return.Errors = consumerConfig.IsReturnErr
|
||||
client, err := sarama.NewClient(addr, config)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
panic(err.Error())
|
||||
}
|
||||
consumerGroup, err := sarama.NewConsumerGroupFromClient(groupID, client)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
panic(err.Error())
|
||||
}
|
||||
return &MConsumerGroup{
|
||||
consumerGroup,
|
||||
@@ -47,7 +47,7 @@ func (mc *MConsumerGroup) RegisterHandleAndConsumer(handler sarama.ConsumerGroup
|
||||
for {
|
||||
err := mc.ConsumerGroup.Consume(ctx, mc.topics, handler)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
panic(err.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ func NewKafkaProducer(addr []string, topic string) *Producer {
|
||||
|
||||
producer, err := sarama.NewSyncProducer(p.addr, p.config) //Initialize the client
|
||||
if err != nil {
|
||||
panic(err)
|
||||
panic(err.Error())
|
||||
return nil
|
||||
}
|
||||
p.producer = producer
|
||||
|
||||
Reference in New Issue
Block a user