Send kafka notification messages in batches when queue_dir is enabled (#18164)

Fixes #18124
This commit is contained in:
Praveen raj Mani
2023-10-07 20:37:38 +05:30
committed by GitHub
parent 0de2b9a1b2
commit c27d0583d4
19 changed files with 438 additions and 90 deletions

View File

@@ -264,7 +264,7 @@ func (target *ElasticsearchTarget) send(eventData event.Event) error {
}
// SendFromStore - reads an event from store and sends it to Elasticsearch.
func (target *ElasticsearchTarget) SendFromStore(eventKey string) error {
func (target *ElasticsearchTarget) SendFromStore(key store.Key) error {
if err := target.init(); err != nil {
return err
}
@@ -277,7 +277,7 @@ func (target *ElasticsearchTarget) SendFromStore(eventKey string) error {
return err
}
eventData, eErr := target.store.Get(eventKey)
eventData, eErr := target.store.Get(key.Name)
if eErr != nil {
// The last event key in a successful batch will be sent in the channel atmost once by the replayEvents()
// Such events will not exist and wouldve been already been sent successfully.
@@ -295,7 +295,7 @@ func (target *ElasticsearchTarget) SendFromStore(eventKey string) error {
}
// Delete the event from store.
return target.store.Del(eventKey)
return target.store.Del(key.Name)
}
// Close - does nothing and available for interface compatibility.