public interface PubSubOperations
Modifier and Type | Method and Description |
---|---|
org.springframework.util.concurrent.ListenableFuture<String> |
publish(String topic,
byte[] payload,
Map<String,String> headers)
Send a message to Pub/Sub.
|
org.springframework.util.concurrent.ListenableFuture<String> |
publish(String topic,
com.google.protobuf.ByteString payload,
Map<String,String> headers)
Send a message to Pub/Sub.
|
org.springframework.util.concurrent.ListenableFuture<String> |
publish(String topic,
com.google.pubsub.v1.PubsubMessage pubsubMessage)
Send a message to Pub/Sub.
|
org.springframework.util.concurrent.ListenableFuture<String> |
publish(String topic,
String payload,
Map<String,String> headers)
Send a message to Pub/Sub.
|
org.springframework.util.concurrent.ListenableFuture<String> |
publish(String topic,
String payload,
Map<String,String> headers,
Charset charset)
Send a message to Pub/Sub.
|
List<com.google.pubsub.v1.PubsubMessage> |
pull(String subscription,
Integer maxMessages,
Boolean returnImmediately,
com.google.api.gax.retrying.RetrySettings retrySettings)
Pull and auto-acknowledge a number of messages from a Google Cloud Pub/Sub subscription.
|
com.google.pubsub.v1.PubsubMessage |
pullNext(String subscription)
Pull and auto-acknowledge a message from a Google Cloud Pub/Sub subscription.
|
com.google.cloud.pubsub.v1.Subscriber |
subscribe(String subscription,
com.google.cloud.pubsub.v1.MessageReceiver messageHandler)
Add a callback method to an existing subscription.
|
org.springframework.util.concurrent.ListenableFuture<String> publish(String topic, String payload, Map<String,String> headers)
topic
- the name of an existing topicpayload
- the message String payloadheaders
- map of String to String headersorg.springframework.util.concurrent.ListenableFuture<String> publish(String topic, String payload, Map<String,String> headers, Charset charset)
topic
- the name of an existing topicpayload
- the message String payloadheaders
- map of String to String headerscharset
- charset to decode the payloadorg.springframework.util.concurrent.ListenableFuture<String> publish(String topic, byte[] payload, Map<String,String> headers)
topic
- the name of an existing topicpayload
- the message payload in bytesheaders
- map of String to String headersorg.springframework.util.concurrent.ListenableFuture<String> publish(String topic, com.google.protobuf.ByteString payload, Map<String,String> headers)
topic
- the name of an existing topicpayload
- the message payload on the PubsubMessage
payload formatheaders
- map of String to String headersorg.springframework.util.concurrent.ListenableFuture<String> publish(String topic, com.google.pubsub.v1.PubsubMessage pubsubMessage)
topic
- the name of an existing topicpubsubMessage
- a Google Cloud Pub/Sub API messagecom.google.cloud.pubsub.v1.Subscriber subscribe(String subscription, com.google.cloud.pubsub.v1.MessageReceiver messageHandler)
The created Subscriber
is returned so it can be stopped.
subscription
- the name of an existing subscriptionmessageHandler
- the callback method triggered when new messages arriveList<com.google.pubsub.v1.PubsubMessage> pull(String subscription, Integer maxMessages, Boolean returnImmediately, com.google.api.gax.retrying.RetrySettings retrySettings)
subscription
- the subscription namemaxMessages
- the maximum number of pulled messagesreturnImmediately
- returns immediately even if subscription doesn't contain enough
messages to satisfy maxMessages
retrySettings
- the timeout and retry setting for the pull requestcom.google.pubsub.v1.PubsubMessage pullNext(String subscription)
subscription
- the subscription namenull
if none exists in the subscriptionCopyright © 2018 Pivotal Software, Inc.. All rights reserved.