Giter Club home page Giter Club logo

Comments (2)

artembilan avatar artembilan commented on September 28, 2024

That's not correct.
The PubSubInboundChannelAdapter is an start of the integration flow, which is based on the message channel communication. So, letting end-user to inject his own callback eliminates the PubSubInboundChannelAdapter purpose.

The current solution is absolutely right where we receive a PubSub message, convert it into the SI Message and send to the configured channel. That is how SI works.

What you suggest makes sense outside of the SI. That is what we call MessageListenerContainer. The good sample of that is Spring Kafka: https://github.com/spring-projects/spring-kafka/tree/master/spring-kafka/src/main/java/org/springframework/kafka/listener
and the Inbound Channel Adapter for it: https://github.com/spring-projects/spring-integration-kafka/blob/master/src/main/java/org/springframework/integration/kafka/inbound/KafkaMessageDrivenChannelAdapter.java

I find this PubSub Subscriber as pretty straightforward API that we even don't need that MessageListenerContainer (at least for now).
The good sample for similar approach is MqttPahoMessageDrivenChannelAdapter: https://github.com/spring-projects/spring-integration/blob/master/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/MqttPahoMessageDrivenChannelAdapter.java. Where we don't have any containers and just subscribe to the topics (this.client.subscribe(topics, grantedQos);) and register ourselves as callback - this.client.setCallback(this);.

from spring-cloud-gcp.

joaoandremartins avatar joaoandremartins commented on September 28, 2024

That's great! Yes, that makes sense.

I filed this issue after a conversation with @viniciusccarvalho yesterday, but I might have failed to understand what was actually being talked.
We spoke about this in the scope of the auto/manual PubsubMessage ack/nack. However, it seems like this isn't a good way of getting there.

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.