GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Batch acknowledgement is not working in asynchronous call · Issue #3257 · googleapis/google-cloud-java

Batch acknowledgement is not working in asynchronous call #3257

New issue
Copy link
New issue
Copy link
Closed
Closed
Batch acknowledgement is not working in asynchronous call#3257
Copy link
Assignees
yihanzhen
Labels
api: pubsubIssues related to the Pub/Sub API.type: questionRequest for information or clarification. Not an issue.

Description

@anamika-papajohns
anamika-papajohns
opened on May 11, 2018
Issue body actions

We are having the requirement of creating a batch of messages on every one minute.
Once batch is processed and return success in response, we need to acknowledge all the messages which were present in that batch.
If batch process response is failure , we need to unacknowledged the messages.

Current functionality given by pub/sub library: In asynchronous call, we can ack/nack message one by one, immediate after receiving.

Below is our code snippet-

Subscriber.Builder builder = Subscriber.newBuilder(subscription, new MessageReceiver() {
                @Override
                public void receiveMessage(PubsubMessage message, AckReplyConsumer consumer) {
                    // handle incoming message, then ack/nack the received message
              try {                             
                       //dropping the message in a queue
                      //here we are creating a batch on every one minute and ack/nack the message accordingly
                                
                     }

also do we have any method to get ackId instead of MessageId in case of asynchronous call.

Activity

  1. yihanzhen
    added
    type: questionRequest for information or clarification. Not an issue.
    api: pubsubIssues related to the Pub/Sub API.
    on May 18, 2018
  2. pongad commented on May 21, 2018

    @pongad
    pongad
    on May 21, 2018
    Contributor
    More actions

    @anamika-papajohns Let's see if I understand this right:

    You want to pull many messages, process all of them, and either ack or nack all messages you pulled, is this right?

    I don't think this use case is well-supported by pubsub. The reason is that pubsub guarantees "at least 1 delivery". If you ack 10 messages, sometimes some of the acks will be lost and some messages will get redelivered.

    Is it possible to, for example, pack "sub-messages" into one pubsub message?

  3. pongad
    self-assigned this
    on May 21, 2018
  4. pongad
    removed their assignment
    on Jun 4, 2018
  5. yihanzhen
    self-assigned this
    on Jun 5, 2018
  6. yihanzhen commented on Jun 13, 2018

    @yihanzhen
    yihanzhen
    on Jun 13, 2018
    Contributor
    More actions

    It seems the problem is solved here. Please ask for reopening if not.

  7. yihanzhen
    closed this as completedon Jun 13, 2018
  8. theacodes
    unassigned
    yihanzhen
    on Sep 28, 2018
  9. JustinBeckwith
    assigned
    yihanzhen
    on Feb 1, 2021
  10. suztomo
    added a commit that references this issue on Mar 9, 2026

    fix: Remove @internalapi from TableResult (#3257)

    19d92a1
  11. chingor13
    added 3 commits that reference this issue on Mar 24, 2026

    fix: address incorrect universe domain validation when quota project …

    ce9a6c7

    chore(main): release 2.47.0 (#3261)

    25e9c85

    chore: unflake ITAsyncAPITest.invalidDatabase (#3257)

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

Metadata

Metadata

Assignees

  • @yihanzhen
    yihanzhen

Labels

api: pubsubIssues related to the Pub/Sub API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.