Message Batching

Messages are processed in batches with the transactions possible on the consumer side, producer side, or both. The optimal configuration depends on your specific use case.

The main considerations when deciding the size of the batch size are:

  • A larger batch size can improve throughput but could lead to higher number of duplicates if producer side transactions are not enabled.
  • Transactions on the producer side provide duplicate protection.

Solace recommends that you test different configurations to determine the optimal settings for your use case. For more information, see the section on binder configuration options for available options and default values.

The batch size can be configured to 1 to disable batching. It's important to note that all messages in the batch are rejected if both the following conditions exist:

  • The batchMaxSize is more than 1.

  • An error occurs during the processing of any message within the batch.

For example, if you have a batch of 50 messages and one message fails, all 50 messages in the batch are rejected.

For more information, see JMS Binder Configuration Options.

Batching and Metrics

The solace.connector.process and solace.connector.error.process metrics apply to batches. These metrics are incremented once per batch, not once per message. To get a count of number of messages processed, use the solace.connector.publish.ack metric.

For more information, see Managing Metrics.