PubSubTemplate
bean to send and receive messages.gcloud
command line, then it'll automatically use Pub/Sub topics/subscriptions from the project you configured in gcloud
.PubSubMessageConverter
bean in order for Spring Cloud GCP Pub/Sub to automatically serialize a POJO into JSON payload,ThreadPoolTaskScheduler
named pubsubSubscriberThreadPool
.PubSubPublisherTemplate
to easily publish a message.PubSubSubscriberTemplate
.PubSubReactiveFactory
.InboundChannelAdapter
and MessageHandler
.PubSubInboundChannelAdapter
.ServiceActivator
annotation.PubSubMessageHandler
to bind it to a channel by using the ServiceActivator
annotation.PubSubMessageHandler
.Function
, Consumer
, and Supplier
. Messaging infrastructure (such as a Pub/Sub Topic or Subscription) can be bound to these functions at the runtime.Consumer
.processOrder
consumer with applications.properties
configuration. See Spring Cloud Streams documentation on the binding naming convention, where processOrder
becomes processorOrder-in-0
.[destination-name].[consumer-group-name]
. So in this example, a subscription named orders.orders-processor-group
will be automatically created.Function
.Supplier
. Supplier can be used in two ways, either supply the object itself, or supply a Flux
that can then continuously emit new messages. Read Spring Cloud Streams documentation for more information.order-processed
topic.