Open woodsmur opened 3 years ago
It seems like in your case, you want to know which items were sucesfully executed (indexed, updated, deleted, ...), and which were not. For this, you should be able to use the OnSuccess
callback, which you register for each item. In the example you've linked, a counter is increased for demonstration purposes, but in your case, you can call the "ack" or "nack" methods for your message?
I have to send an array of messages coming from pulsar topic to send to es using
esutil.NewBulkIndexer
. I need to callmsg.ack
when messages are successful to send, andmsg.nack(negative ack)
when messages are failed to send to es.From indexer.go, I could only get the number from
bi.Stats()
. How can I determine which messages are successful or failed to send when using bulk indexer, so that I can do some extra process, like ack the pulsar message.In elasticsearch java client, I can iterator
bulkResponse
's items and check if request is failed throughIsFailed
. Can I do it the same way in go client?Thanks