Git Product home page Git Product logo

Comments (5)

artembilan avatar artembilan commented on July 20, 2024

The .awaitRunning() is not good. It eliminates the purpose of the startAsync().

Would be better to use void addListener(ApiService.Listener var1, Executor var2); to log in case of
failed(ApiService.State from, Throwable failure)

from spring-cloud-gcp.

joaoandremartins avatar joaoandremartins commented on July 20, 2024

Another (more expensive, but more explicit) alternative is to make an explicit check for the existence of the Subscription using the getSubscription() method. We could also create the Subscription if it doesn't exist.

This behaviour should be parameterised.

from spring-cloud-gcp.

balopat avatar balopat commented on July 20, 2024

@artembilan logging sounds good, however, that still doesn't solve the need from the client code to have an explicit way to inspect/handle subscription errors and have the option to fail/retry/ignore.
@joaoandremartins I like the idea of having the option to auto-create the subscription.

I guess we could combine the two suggested behaviors: we listen on the lifecycle events and "on failure" we can inspect if the error is due to missing subscription ("NOT_FOUND: Resource not found (resource=[subscription])." and if that's the case we can have a configurable behavior + a status accessible from the client side probably via a status listener?

from spring-cloud-gcp.

artembilan avatar artembilan commented on July 20, 2024

Well, in other places we expose the ApplicationEvent architecture to let end-user to do what is the best for him there. For example ListenerContainerConsumerFailedEvent in the Spring AMQP: http://docs.spring.io/spring-amqp/reference/html/_reference.html#consumer-events. Or MqttIntegrationEvent hierarchy: http://docs.spring.io/spring-integration/reference/html/mqtt.html#mqtt-inbound

from spring-cloud-gcp.

joaoandremartins avatar joaoandremartins commented on July 20, 2024

This was apparently fixed in a recent version of the google-cloud-pubsub library, as I'm now seeing errors logged when trying to subscribe to a non-existing subscription.

from spring-cloud-gcp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.