Reputation: 399
Following documentation, there are multiple ways to integrate Google Cloud PubSub events with Spring application:
Spring Cloud GCP has several modules for sending messages to Pub/Sub topics and receiving messages from Pub/Sub subscriptions using the Spring Framework. You can use these modules independently or combine them for different use cases:
- Spring Cloud GCP Pub/Sub Starter lets you send and receive messages using helper classes and call the Pub/Sub Java client library for more advanced scenarios.
- Spring Integration Channel Adapters for Pub/Sub let you connect Spring Integration Message Channels with Pub/Sub.
- Spring Cloud Stream Binder for Pub/Sub lets you use Pub/Sub as messaging middleware in Spring Cloud Stream applications.
I don't have full understanding - what are those different use cases mentioned, and how to determine, which module is best for which use case?
Application (Dockerized Spring Boot app, deployed to Kubernetes in GCP) I am working on is rather simple, it is expected to act upon received PubSub event, it is not going to publish any events itself.
Upvotes: 1
Views: 772
Reputation: 1475
Spring Cloud GCP Pub/Sub Starter
module contains the java client classes for pub sub which will be used by your spring application to perform administrative and functional operations (ie. sending and receiving messages).
Spring Integration Channel Adapters for Pub/Sub
module is utilized when your spring application uses Message Channels. This module will help routing message between message channel and pub/sub using channel adapters.
Spring Cloud Stream Binder for Pub/Sub
module is used in Spring Cloud Stream Applications in order to utilize cloud Pub/Sub API.
Since, your application requirements are basic you can easily go for Spring Cloud GCP Pub/Sub Starter module. For more information you can refer to this Google documentation.
Upvotes: 0