• Glossary
  • Support
  • Downloads
  • DataStax Home
Get Live Help
Expand All
Collapse All

DataStax Streaming Home

Starlight For JMS Documentation

    • Github repo
    • Starlight for JMS FAQs
    • Examples
      • Batch index acknowledgement
      • Starlight for JMS implementation details
      • Enabling server-side filters
    • JMS Migration
      • Installing Starlight for JMS
      • Starlight for JMS standalone quick start
    • Reference
      • Mapping Pulsar concepts to JMS specifications
      • Starlight for JMS configuration reference
  • Starlight For JMS Documentation
  • Examples
Edit this Page

Batch index acknowledgement

Starlight for JMS improves acknowledgement of batched messages by supporting the tracking of 'ack' status by batch index.

By default, filtering works on the entry level in Pulsar. An entry is a single message or a single batch of messages. The client will not filter out a few messages in a batch; it either passes completely or fails completely.

With batch index acknowledgement, when the broker dispatches messages, it will carry the batch index that has been acknowledged. The client will filter out batch indexes that have been acked.

The client sends the batch index ack information to the broker, so the broker can maintain the batch index ack status.

This approach requires cooperation between the client and broker, so we must modify both broker.conf and the consumerConfig JMS client property to enable batch acknowledgement.

DataStax strongly recommends these configurations for increased efficiency, whether using broker-side or client-side selectors.

Enable batch index acknowledgement

  1. Add the configuration property acknowledgmentAtBatchIndexLevelEnabled=true to broker.conf:

    acknowledgmentAtBatchIndexLevelEnabled=true
  2. Set the consumerConfig property on the JMS client by adding consumerConfig.put("batchIndexAckEnabled", true); to consumerConfig in the ConnectionFactory configuration:

        Map<String, Object> properties = new HashMap<>();
        properties.put("webServiceUrl", cluster.getAddress());
        Map<String, Object> consumerConfig = new HashMap<>();
        consumerConfig.put("batchIndexAckEnabled", true);
        properties.put("consumerConfig", consumerConfig);
        try (PulsarConnectionFactory factory = new PulsarConnectionFactory(properties));

What’s next?

For more on server-side filtering, see Server side filters.
For more on acknowledgements in Starlight for JMS, see Consumer Mappings.

Starlight for JMS FAQs Starlight for JMS implementation details

General Inquiries: +1 (650) 389-6000 info@datastax.com

© DataStax | Privacy policy | Terms of use

DataStax, Titan, and TitanDB are registered trademarks of DataStax, Inc. and its subsidiaries in the United States and/or other countries.

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.

Kubernetes is the registered trademark of the Linux Foundation.

landing_page landingpage