| Interface | Description |
|---|---|
| AckReplyConsumer |
Accepts a reply, sending it to the service.
|
| MessageReceiver |
This interface can be implemented by users of
Subscriber to receive messages. |
The interfaces provided are listed below, along with usage samples.
================ TopicAdminClient ================
Service Description: The service that an application uses to manipulate topics, and to send messages to a topic.
To publish messages to a topic, see the Publisher class.
Sample for TopicAdminClient:
try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
TopicName name = TopicName.of("[PROJECT]", "[TOPIC]");
Topic response = topicAdminClient.createTopic(name);
}
======================= SubscriptionAdminClient =======================
Service Description: The service that an application uses to manipulate subscriptions and to consume messages from a subscription via the `Pull` method.
To retrieve messages from a subscription, see the Subscriber class.
Sample for SubscriptionAdminClient:
try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
TopicName topic = TopicName.of("[PROJECT]", "[TOPIC]");
PushConfig pushConfig = PushConfig.newBuilder().build();
int ackDeadlineSeconds = 0;
Subscription response = subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);
}
Copyright © 2017 Google. All rights reserved.