The latest version of the client offers a bulk indexer, which automatically handles the retries and lets you pick the flush bytes threshold.
You can find the bulk indexer documentation here.
The mechanics are slightly different, you can only know if a document has failed, so the insert event, which as far as I know it is only used for testing, will not be emitted more than once.
The test now will fail because I didn't update the monkey patch yet, but I wanted to have an early feedback before continuing, especially around the stream handling.
This pr makes useless the bulk-size option, as the client's bulk indexer needs a value in bytes. This because you can't know in advance the size of a log, and could risk sending a big number of very big logs or very few small logs. The ability to set the flush size in bytes solves this problem.
A nice side effect of using the bulk indexer is that we gain the automatic retry of failed documents for free ;)
The latest version of the client offers a bulk indexer, which automatically handles the retries and lets you pick the flush bytes threshold. You can find the bulk indexer documentation here.
The mechanics are slightly different, you can only know if a document has failed, so the
insert
event, which as far as I know it is only used for testing, will not be emitted more than once. The test now will fail because I didn't update the monkey patch yet, but I wanted to have an early feedback before continuing, especially around the stream handling.This pr makes useless the
bulk-size
option, as the client's bulk indexer needs a value in bytes. This because you can't know in advance the size of a log, and could risk sending a big number of very big logs or very few small logs. The ability to set the flush size in bytes solves this problem.A nice side effect of using the bulk indexer is that we gain the automatic retry of failed documents for free ;)