davsclaus commented on code in PR #27173: URL: https://github.com/apache/camel/pull/27173#discussion_r4318034844
########## components/camel-sjms/src/main/docs/sjms-component.adoc: ########## @@ -312,3 +312,34 @@ Currently, the only correlation strategy is to use the `JMSCorrelationId`. The _InOut_ Consumer uses this strategy as well ensuring that all response messages to the included `JMSReplyTo` destination also have the `JMSCorrelationId` copied from the request as well. + +=== Batch consuming + +The consumer can be configured to receive messages in batches instead of one at a time, by setting +`batching=true`. Instead of one Exchange per message, the route receives a single Exchange whose body +is a `List<Exchange>`, one per JMS message in the batch, with a `CamelSjmsBatchSize` header giving the +batch's size. Each Exchange in the batch is comparable to the Exchange generated by a non-batching consumer. + +Batching only supports the InOnly exchange pattern. There is no reply-to/request-response support for +batched consumption — a batch of N unrelated messages has no well-defined single reply, so InOut +routes are not supported when `batching=true`. + +A batch completes when either `batchSize` messages have been received, or the `batchInterval` — +measured from the first message in the batch — has elapsed. + +Commit/acknowledgement happens once per batch rather than once per message. With +`acknowledgementMode=AUTO_ACKNOWLEDGE`, messages are acknowledged as they're received into the batch, +before routing — so a failed batch cannot be redelivered. Use `transacted=true` or +`acknowledgementMode=CLIENT_ACKNOWLEDGE` if the whole batch should be redelivered together on failure. + +A failed batch is rolled back and redelivered as a whole, so the route should be idempotent. One bad message +fails, and redelivers, the whole batch: all its messages share the delivery count, and they end up together Review Comment: Fixed in 5f4ff1b4fc: the paragraph now reads "One bad message fails the whole batch, which is then redelivered", in the source page and its catalog copy. _Claude Code on behalf of Claus Ibsen_ ########## components/camel-sjms2/src/main/docs/sjms2-component.adoc: ########## @@ -316,3 +316,34 @@ Currently, the only correlation strategy is to use the `JMSCorrelationId`. The _InOut_ Consumer uses this strategy as well ensuring that all response messages to the included `JMSReplyTo` destination also have the `JMSCorrelationId` copied from the request as well. + +=== Batch consuming + +The consumer can be configured to receive messages in batches instead of one at a time, by setting +`batching=true`. Instead of one Exchange per message, the route receives a single Exchange whose body +is a `List<Exchange>`, one per JMS message in the batch, with a `CamelSjmsBatchSize` header giving the +batch's size. Each Exchange in the batch is comparable to the Exchange generated by a non-batching consumer. + +Batching only supports the InOnly exchange pattern. There is no reply-to/request-response support for +batched consumption — a batch of N unrelated messages has no well-defined single reply, so InOut +routes are not supported when `batching=true`. + +A batch completes when either `batchSize` messages have been received, or the `batchInterval` — +measured from the first message in the batch — has elapsed. + +Commit/acknowledgement happens once per batch rather than once per message. With +`acknowledgementMode=AUTO_ACKNOWLEDGE`, messages are acknowledged as they're received into the batch, +before routing — so a failed batch cannot be redelivered. Use `transacted=true` or +`acknowledgementMode=CLIENT_ACKNOWLEDGE` if the whole batch should be redelivered together on failure. + +A failed batch is rolled back and redelivered as a whole, so the route should be idempotent. One bad message +fails, and redelivers, the whole batch: all its messages share the delivery count, and they end up together Review Comment: Fixed in 5f4ff1b4fc: the paragraph now reads "One bad message fails the whole batch, which is then redelivered", in the source page and its catalog copy. _Claude Code on behalf of Claus Ibsen_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
