Skip to content
Advertisement

How to publish a Pub/Sub message with a Supplier bean?

I want to publish a Pub/Sub message in Spring according to the Google documentation (see https://cloud.google.com/pubsub/docs/spring#publishing-messages-using-stream-binder). The only problem is that I am new to Spring Framework and I have no idea of how to turn this example into something that I can use. That is, a method that allows me to send a specific message from a service to the Pub/Sub topic.

JavaScript

How can I write a method that allows me to send a specific message (lets say a ‘String’) to my Pub/Sub topic that can be called from a service?

Advertisement

Answer

I am now using an old and deprecated method with Channels, but it works fine so far.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement