Skip to content

CAMEL-23443: camel-pulsar - expose enableBatchIndexAcknowledgment#23485

Open
rkdfx wants to merge 1 commit into
apache:mainfrom
rkdfx:CAMEL-23443-pulsar-batch-index-ack
Open

CAMEL-23443: camel-pulsar - expose enableBatchIndexAcknowledgment#23485
rkdfx wants to merge 1 commit into
apache:mainfrom
rkdfx:CAMEL-23443-pulsar-batch-index-ack

Conversation

@rkdfx
Copy link
Copy Markdown

@rkdfx rkdfx commented May 23, 2026

Description

Adds a new consumer-side URI option enableBatchIndexAcknowledgment to the camel-pulsar
component.

The Pulsar client's ConsumerBuilder supports
enableBatchIndexAcknowledgment(boolean) to allow each message in a batch to be acknowledged
independently. With the option disabled (the Pulsar client default), a single failed
acknowledgment causes the broker to redeliver the entire batch — including messages that were
processed successfully. The component previously built the ConsumerBuilder without invoking
this method and exposed no URI parameter to configure it.

This change:

  • Adds the option as a @UriParam(label = "consumer") field on PulsarConfiguration with
    default false (matches the Pulsar client's own default — no behaviour change for existing
    routes).
  • Wires it into CommonCreationStrategyImpl in the same shape as the existing readCompacted
    option (unconditional pass-through onto the ConsumerBuilder).
  • Adds a default-value assertion to PulsarComponentTest.testPulsarEndpointDefaultConfiguration
    and a new URI-parsing test testPulsarEndpointEnableBatchIndexAcknowledgment.

Enabling this option also requires the Pulsar broker to be configured with
acknowledgmentAtBatchIndexLevelEnabled=true for the per-message acknowledgments to take
effect. This is documented in the option's description.

Resolves https://issues.apache.org/jira/browse/CAMEL-23443

Target

  • I checked that the commit is targeting the correct branch (Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.
  • I have run mvn clean install -DskipTests locally from root folder and I have committed all auto-generated changes.

Signed-off-by: Ravi <13908473+rkdfx@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, well-structured PR. The new enableBatchIndexAcknowledgment consumer option is properly implemented:

  • @UriParam(label = "consumer") with a clear description that documents the broker-side prerequisite (acknowledgmentAtBatchIndexLevelEnabled=true)
  • Default false matches the Pulsar client's own default — no behavior change for existing routes
  • Wired into CommonCreationStrategyImpl consistently alongside the existing readCompacted option
  • Tests cover both the default value assertion and the URI-parsing path
  • All generated files (catalog, configurers, URI factory) are committed

Looks good to merge.

Claude Code on behalf of Guillaume Nodet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants