I have implemented a google pubsub topic-subscriber (spring-boot and cloud stream framework) using the spring.io guides example.
App starts consuming the messages as soon as the app is up. I would like to implement an api where we start and stop the consumption of messages on demand.
Let's say GET /pubsub/messages -> start the subscriber -> gets messages (synchronous or asynchronous) -> stops the subscriber.
Any thoughts would be helpful.