public static class Publisher.ListenerAdapter extends Object implements Publisher.Listener
| Constructor and Description |
|---|
ListenerAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
publisherClosed(Publisher publisher)
Called when a
Publisher is closed. |
void |
publisherCreated(Publisher publisher)
Called when a new
Publisher is instantiated. |
void |
publishingMessage(Publisher publisher,
String topic,
Message message,
CompletableFuture<String> future)
Called when a
Publisher receieves a new message for publication. |
void |
sendingBatch(Publisher publisher,
String topic,
List<Message> batch,
CompletableFuture<List<String>> future)
Called when a
Publisher is sending a batch of messages to Google Cloud Pub/Sub. |
void |
sendingBatch(Publisher publisher,
String topic,
List<Message> batch,
PubsubFuture<List<String>> future)
Called when a
Publisher is sending a batch of messages to Google Cloud Pub/Sub. |
void |
topicPending(Publisher publisher,
String topic,
int outstanding,
int concurrency)
Called when a topic is enqueued as pending for future batch sending due to the publisher hitting the concurrency
limit.
|
public void publisherCreated(Publisher publisher)
Publisher.ListenerPublisher is instantiated.publisherCreated in interface Publisher.Listenerpublisher - The Publisherpublic void publisherClosed(Publisher publisher)
Publisher.ListenerPublisher is closed.publisherClosed in interface Publisher.Listenerpublisher - The Publisherpublic void publishingMessage(Publisher publisher, String topic, Message message, CompletableFuture<String> future)
Publisher.ListenerPublisher receieves a new message for publication.publishingMessage in interface Publisher.Listenerpublisher - The Publishertopic - The message topic.message - The message.future - The future result.public void sendingBatch(Publisher publisher, String topic, List<Message> batch, PubsubFuture<List<String>> future)
Publisher.ListenerPublisher is sending a batch of messages to Google Cloud Pub/Sub.sendingBatch in interface Publisher.Listenerpublisher - The Publishertopic - The topic of the message batch.batch - The batch of messages being sent.future - The future result of the entire batch.public void sendingBatch(Publisher publisher, String topic, List<Message> batch, CompletableFuture<List<String>> future)
Publisher.ListenerPublisher is sending a batch of messages to Google Cloud Pub/Sub.sendingBatch in interface Publisher.Listenerpublisher - The Publishertopic - The topic of the message batch.batch - The batch of messages being sent.future - The future result of the entire batch.public void topicPending(Publisher publisher, String topic, int outstanding, int concurrency)
Publisher.ListenertopicPending in interface Publisher.Listenerpublisher - The Publishertopic - The topic.outstanding - The current number of outstanding batch requests to Google Cloud Pub/Sub.concurrency - The configured concurrency limit.Copyright © 2018. All rights reserved.