Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questa pagina descrive come utilizzare Pub/Sub nelle applicazioni Java create con
Spring Framework.
Spring Cloud GCP dispone di diversi moduli per l'invio di messaggi agli argomenti Pub/Sub e la ricezione di messaggi dalle sottoscrizioni Pub/Sub utilizzando Spring Framework. Puoi utilizzare
questi moduli in modo indipendente o combinarli per diversi casi d'uso:
Spring Cloud GCP Pub/Sub Starter
ti consente di inviare e ricevere messaggi utilizzando classi helper
e chiamare la libreria client Java Pub/Sub per scenari più avanzati.
Gli adattatori del canale di integrazione Spring per Pub/Sub ti consentono di connettere i canali di messaggi di integrazione Spring con Pub/Sub.
Spring Cloud Stream Binder per Pub/Sub ti consente di utilizzare Pub/Sub come
middleware di messaggistica nelle applicazioni Spring Cloud Stream.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[],[],null,["# Using Pub/Sub in Spring applications\n\nThis page describes how to use Pub/Sub in Java applications built with\nthe [Spring Framework](https://spring.io/projects/spring-framework).\n\n[Spring Cloud GCP](https://googlecloudplatform.github.io/spring-cloud-gcp/reference/html/index.html) has several modules for sending\nmessages to Pub/Sub topics and receiving messages from\nPub/Sub subscriptions using the Spring Framework. You can use\nthese modules independently or combine them for different use cases:\n\n- **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.\n- **Spring Integration Channel Adapters for Pub/Sub** let you connect Spring Integration [Message Channels](https://docs.spring.io/spring-integration/reference/channel.html) with Pub/Sub.\n- **Spring Cloud Stream Binder for Pub/Sub** lets you use Pub/Sub as messaging middleware in Spring Cloud Stream applications.\n\n| **Note:** The [Spring Cloud GCP](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-pubsub/src)Library does not provide access to [AckReplyConsumerWithResponse](/java/docs/reference/google-cloud-pubsub/latest/com.google.cloud.pubsub.v1.AckReplyConsumerWithResponse), which is a required module to implement the exactly-once feature using the Java client library.\n\nUsing Spring Cloud GCP Pub/Sub Starter\n--------------------------------------\n\nFollow [Spring Framework on Google Cloud reference guide - Cloud Pub/Sub](https://googlecloudplatform.github.io/spring-cloud-gcp/reference/html/index.html#cloud-pubsub)\nfor further details on the Spring Cloud GCP Pub/Sub Starter and instructions on how to use it.\n\nUsing Spring Integration channel adapters\n-----------------------------------------\n\nFollow [Spring Framework on Google Cloud reference guide - Channel Adapters for Cloud Pub/Sub](https://googlecloudplatform.github.io/spring-cloud-gcp/reference/html/index.html#channel-adapters-for-cloud-pubsub)\nfor further details on the Spring Integration channel adapters and instructions on how to use them.\n\nUsing Spring Cloud Stream Binder\n--------------------------------\n\nFollow [Spring Framework on Google Cloud reference guide - Spring Cloud Stream Binder for Cloud Pub/Sub](https://googlecloudplatform.github.io/spring-cloud-gcp/reference/html/index.html#spring-cloud-stream)\nfor further details on the Spring Cloud Stream Binder and instructions on how to use it."]]