You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This method returns a `ProducerBuilder` instance, which contains a few methods to configure your kafka producer.
15
15
The following lines describes these methods.
16
16
17
-
If you are going to produce a lot of messages to different topics, please use the `asyncPublish` method on the `Junges\Kafka\Facades\Kafka` class:
17
+
The default `publish()` method now uses asynchronous publishing for better performance. Messages are queued and flushed when the application terminates:
The main difference is that the Async Producer is a singleton and will only flush the producer when the application is shutting down, instead of after each send.
26
-
This reduces the overhead when you want to send a lot of messages in your request handlers.
25
+
The async producer is a singleton and will only flush messages when the application is shutting down, instead of after each send.
26
+
This reduces overhead when you want to send a lot of messages in your request handlers.
27
+
28
+
If you need immediate message flushing (synchronous publishing), use the `publishSync()` method:
If you want to send multiple messages, consider using the async producer instead. The default `send` method is recommended for low-throughput systems only, as it
22
-
flushes the producer after every message that is sent.
21
+
The `publish()` method uses asynchronous publishing for better performance, batching messages and flushing them when the application terminates.
22
+
If you need immediate message flushing, use `publishSync()` instead:
-**BREAKING CHANGE**: Deprecated producer batch messages feature has been removed (`MessageBatch`, `sendBatch`, `produceBatch`). Use `Kafka::asyncPublish()` instead for better performance
0 commit comments