tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

About the Golang stream client

Open Gsantomaggio opened this issue 1 year ago • 4 comments

Hi Anton, About the Golang streaming client, here, you used the default settings.

Default settings are more throughput-oriented; the client aggregates the messages and sends them every 100 milliseconds by default. or when the Batch-Size is reached.

You could reduce the timing with

producer, err := env.NewProducer(streamName,stream.NewProducerOptions().SetBatchPublishingDelay(10))

or reduce the batchSize with stream.NewProducerOptions().SetBatchSize(50)

There is also another API, BatchSend, where the aggregation part is up to the user. The API is synchronous.

Please read: https://github.com/rabbitmq/rabbitmq-stream-go-client?tab=readme-ov-file#send-vs-batchsend

and also: https://groups.google.com/g/rabbitmq-users/c/IO_9-BbCzgQ

I hope this helps :)!

Gsantomaggio avatar Oct 24 '24 15:10 Gsantomaggio

thanks, @Gsantomaggio. kafka is a complicated system with a bunch of settings that you can tune and optimize either for latency or throughput, but i appreciate your help. i'll see if i can make any adjustments for the next benchmark between kafka and nats

antonputra avatar Nov 03 '24 14:11 antonputra

well, actually, I was speaking about the RabbitMQ Golang client :)

Gsantomaggio avatar Nov 03 '24 14:11 Gsantomaggio

@Gsantomaggio sorry about that, i usually dive deeper only when i'm working on a specific benchmark

antonputra avatar Nov 03 '24 14:11 antonputra

No problem. I need to include some information on this issue. My fault

That's the benchmark: https://www.youtube.com/watch?v=UPkOsXKG4ns

btw don't worry.

Gsantomaggio avatar Nov 03 '24 14:11 Gsantomaggio