Interface PubSubPublisherOperations

All Known Subinterfaces:
PubSubOperations
All Known Implementing Classes:
PubSubPublisherTemplate, PubSubTemplate

public interface PubSubPublisherOperations
An abstraction for Google Cloud Pub/Sub publisher operations.
Since:
1.1
  • Method Details

    • publish

      <T> CompletableFuture<String> publish(String topic, T payload, Map<String,String> headers)
      Send a message to Pub/Sub.
      Type Parameters:
      T - the type of the payload to publish
      Parameters:
      topic - short topic name, e.g., "topicName", or the fully-qualified topic name in the projects/[project_name]/topics/[topic_name] format
      payload - an object that will be serialized and sent
      headers - the headers to publish
      Returns:
      the listenable future of the call
    • publish

      <T> CompletableFuture<String> publish(String topic, T payload)
      Send a message to Pub/Sub.
      Type Parameters:
      T - the type of the payload to publish
      Parameters:
      topic - short topic name, e.g., "topicName", or the fully-qualified topic name in the projects/[project_name]/topics/[topic_name] format
      payload - an object that will be serialized and sent
      Returns:
      the listenable future of the call
    • publish

      CompletableFuture<String> publish(String topic, com.google.pubsub.v1.PubsubMessage pubsubMessage)
      Send a message to Pub/Sub.
      Parameters:
      topic - short topic name, e.g., "topicName", or the fully-qualified topic name in the projects/[project_name]/topics/[topic_name] format
      pubsubMessage - a Google Cloud Pub/Sub API message
      Returns:
      the listenable future of the call