mirror of
https://github.com/minio/minio.git
synced 2025-11-08 21:24:55 -05:00
Kafka notify: support batched commits for queue store (#20377)
The items will be saved per target batch and will be committed to the queue store when the batch is full Also, periodically commit the batched items to the queue store based on configured commit_timeout; default is 30s; Bonus: compress queue store multi writes
This commit is contained in:
@@ -418,7 +418,7 @@ func (h *Target) startQueueProcessor(ctx context.Context, mainWorker bool) {
|
||||
if !isDirQueue {
|
||||
err = h.send(ctx, buf.Bytes(), count, h.payloadType, webhookCallTimeout)
|
||||
} else {
|
||||
err = h.store.PutMultiple(entries)
|
||||
_, err = h.store.PutMultiple(entries)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
@@ -530,7 +530,7 @@ func New(config Config) (*Target, error) {
|
||||
// SendFromStore - reads the log from store and sends it to webhook.
|
||||
func (h *Target) SendFromStore(key store.Key) (err error) {
|
||||
var eventData []byte
|
||||
eventData, err = h.store.GetRaw(key.Name)
|
||||
eventData, err = h.store.GetRaw(key)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return nil
|
||||
@@ -552,7 +552,7 @@ func (h *Target) SendFromStore(key store.Key) (err error) {
|
||||
}
|
||||
|
||||
// Delete the event from store.
|
||||
return h.store.Del(key.Name)
|
||||
return h.store.Del(key)
|
||||
}
|
||||
|
||||
// Send the log message 'entry' to the http target.
|
||||
|
||||
Reference in New Issue
Block a user