Message batching and transactions
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Batching is a mechanism where the producer of messages holds onto several messages before forwarding them to the broker. By sending a single request that includes multiple messages to the broker, the client reduces network bandwidth at the cost of a bit of latency. For those clients that support it, a single batch can be compressed into a single message. The gains from compression are significantly better when there is more data, compared to single, small messages that may not benefit much individually from compression. How long the client holds the batch, the size in bytes of the batch, or the number of messages in the batch, is configurable by the client.
Transactions
Message transactions allows the producer client to indicate to the server that messages should remain invisible to consumers until the transaction is completed. Multiple messages can be sent to the broker as a single all-or-nothing process. With Apache® Kafka®, message transactions are driven by the client. When batching is used with a transaction, the client may not need to send anything at all to the broker if the transaction fails before any part of the batch is sent to the broker, thus eliminating the entire set of network messages in cases where the client does not complete the transaction.