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 — setReturnImmediately is not configurable in this version of pubsub api · Issue #1299 · googleapis/google-cloud-java

setReturnImmediately is not configurable in this version of pubsub api #1299

New issue
Copy link
New issue
Copy link
Closed
Closed
setReturnImmediately is not configurable in this version of pubsub api#1299
Copy link
Assignees
mziccard

Description

@robin-anil
robin-anil
opened on Sep 29, 2016
Issue body actions

setReturnImmediately(true). This causes latency issues for us. We would like to go back to the long poll. Please expose a way for that

Activity

Next
  1. mziccard commented on Sep 30, 2016

    @mziccard
    mziccard
    on Sep 30, 2016
    Contributor
    More actions

    Hi @r-tock, thanks for your report. This is a duplicate of #1157.

    Did you consider using MessageConsumer pullAsync(String, MessageProcessor, PullOption...)?

     String subscriptionName = "my_subscription_name";
     MessageProcessor callback = new MessageProcessor() {
       public void process(Message message) throws Exception {
         // Ack deadline is renewed until this method returns
         // Message is acked if this method returns successfully
         // Message is nacked if this method throws an exception
       }
     };
     PubSub.MessageConsumer consumer = pubsub.pullAsync(subscriptionName, callback);
     // ...
     // Stop pulling
     consumer.close();

    This method implements continuous pulling and uses setReturnImmediately(false) under the hood.

    We are considering exposing an option to setReturnImmediately(false) also in pullAsync(String, int). If we do that you will have to take care of handling possible timeout exceptions in your application code. Such timeout exceptions come from the fact that with setReturnImmediately(false) it's more likely that the RPC might take more than the maxTimeout() value you set in PubSubOption. Using the MessageConsumer takes care of this for you.

  2. robin-anil commented on Sep 30, 2016

    @robin-anil
    robin-anil
    on Sep 30, 2016
    Author
    More actions

    I tried this however I couldn't get our existing tests to work. the callback was not receiving any data and secondly having this run in a server, I have to now expose all the consumers to the shutdown handler for graceful shutdown of the server. This was a lot harder which pushed me just use the GRPC Stubs directly. Everything worked well for us by doing that.

  3. mziccard commented on Oct 2, 2016

    @mziccard
    mziccard
    on Oct 2, 2016
    Contributor
    More actions

    the callback was not receiving any data

    This is strange. We have integration tests in place and customers using the MessageConsumer. It would be nice if you could file a proper bug report for this.

    Anyway I am closing this as duplicate of #1157

  4. mziccard
    closed this as completedon Oct 2, 2016
  5. JustinBeckwith
    assigned
    mziccard
    on Feb 1, 2021
  6. github-actions
    added 2 commits that reference this issue on Jun 29, 2022

    fix(java): add -ntp flag to native image testing command (googleapis#…

    554b480

    fix(java): add -ntp flag to native image testing command (#1299) (#383)

    85cbc7b
  7. github-actions
    added a commit that references this issue on Aug 18, 2022

    deps: update dependency com.google.cloud:google-cloud-storage to v2.1…

    d59e6c6
  8. github-actions
    added a commit that references this issue on Sep 16, 2022

    chore(main): release 3.6.0 (#1313)

    1fbaf40
  9. suztomo
    added a commit that references this issue on Feb 1, 2023

    chore(main): release 2.0.0 (#739)

    ea9f421
  10. meltsufin
    added 3 commits that reference this issue on Dec 22, 2025

    fix(java): add -ntp flag to native image testing command (#1299) (#780)

    3f70b62

    chore: release 3.5.2 (#779)

    013bb50

    build(deps): update dependency org.apache.maven.plugins:maven-surefir…

    13a2c73
  11. chingor13
    added 2 commits that reference this issue on Jan 6, 2026

    fix(java): add -ntp flag to native image testing command (#1299) (#606)

    bed601e

    deps: update actions/github-script action to v7 (#1299)

    80d6f4c
  12. 3 remaining items

  13. chingor13
    added a commit that references this issue on Feb 24, 2026

    Revert "feat: add code sample and test for getting an access token fr…

    2d867b0
  14. suztomo
    added 3 commits that reference this issue on Mar 11, 2026

    fix(java): add -ntp flag to native image testing command (googleapis#…

    b2577a3

    chore: release 3.5.2 (googleapis#779)

    7bf2e33

    build(deps): update dependency org.apache.maven.plugins:maven-surefir…

    e26e91d
  15. chingor13
    added 2 commits that reference this issue on Mar 12, 2026

    fix(java): add -ntp flag to native image testing command (#1299) (#807)

    4be0d5a

    Revert "feat: add code sample and test for getting an access token fr…

    f012163
  16. lqiu96
    added a commit that references this issue on Mar 20, 2026

    feat: Java datastore gapic upgrade (#1824)

    b80fba0
  17. suztomo
    added 2 commits that reference this issue on Mar 23, 2026

    fix(java): add -ntp flag to native image testing command (googleapis#…

    f03ebc6

    chore(deps): update dependency com.google.cloud:libraries-bom to v26.…

    02c65bd
  18. suztomo
    added 2 commits that reference this issue on Mar 30, 2026

    deps: update actions/github-script action to v7 (#1299)

    56cc479

    chore(main): release 0.127.8 (#1310)

    b93b7b0
  19. lqiu96
    added 2 commits that reference this issue on Apr 1, 2026

    deps: update actions/github-script action to v7 (#1299)

    dc8c4e8

    chore(main): release 0.127.8 (#1310)

    95ac931
  20. meltsufin
    added 2 commits that reference this issue on Apr 29, 2026

    deps: update dependency com.google.cloud:google-cloud-core to v2.8.15 (…

    11f220c

    deps: update dependency com.google.cloud:google-cloud-core to v2.8.15 (…

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

Metadata

Metadata

Assignees

  • @mziccard
    mziccard

Labels

No labels
No labels

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.