elastic / go-elasticsearch

The official Go client for Elasticsearch
https://github.com/elastic/go-elasticsearch#go-elasticsearch
Apache License 2.0
5.54k stars 609 forks source link

The issue of automatic message retry #859

Closed wd-h2 closed 1 month ago

wd-h2 commented 1 month ago

`err := consumerClient.Subscribe(mounter.topic, consumer.MessageSelector{}, func(ctx context.Context, msgs ...*primitive.MessageExt) (consumer.ConsumeResult, error) { err := mounter.logic.Execute(msgs) if err != nil { c.svcCtx.Log.Sugar().Errorf("cosumer_topic_msg:%s:err:%s", mounter.topic, err.Error())

        return consumer.ConsumeRetryLater, nil
    }

    return consumer.ConsumeSuccess, nil
})
if err != nil {
    return
}`

consumer.ConsumeRetryLater :No automatic retry, is there a solution ?

Anaethelion commented 1 month ago

Hello there,

I think you have the wrong library, nothing in the code above fits this repository.

Closing now.