Interface PublisherGrpc.AsyncService (1.135.0)

public static interface PublisherGrpc.AsyncService

The service that an application uses to manipulate topics, and to send messages to a topic.

Methods

createTopic(Topic request, StreamObserver<Topic> responseObserver)

public default void createTopic(Topic request, StreamObserver<Topic> responseObserver)

Creates the given topic with the given name. See the resource name rules.

Parameters
Name Description
request Topic
responseObserver io.grpc.stub.StreamObserver<Topic>

deleteTopic(DeleteTopicRequest request, StreamObserver<Empty> responseObserver)

public default void deleteTopic(DeleteTopicRequest request, StreamObserver<Empty> responseObserver)

Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted, but their topic field is set to deleted-topic.

Parameters
Name Description
request DeleteTopicRequest
responseObserver io.grpc.stub.StreamObserver<Empty>

detachSubscription(DetachSubscriptionRequest request, StreamObserver<DetachSubscriptionResponse> responseObserver)

public default void detachSubscription(DetachSubscriptionRequest request, StreamObserver<DetachSubscriptionResponse> responseObserver)

Detaches a subscription from this topic. All messages retained in the subscription are dropped. Subsequent Pull and StreamingPull requests will return FAILED_PRECONDITION. If the subscription is a push subscription, pushes to the endpoint will stop.

Parameters
Name Description
request DetachSubscriptionRequest
responseObserver io.grpc.stub.StreamObserver<DetachSubscriptionResponse>

getTopic(GetTopicRequest request, StreamObserver<Topic> responseObserver)

public default void getTopic(GetTopicRequest request, StreamObserver<Topic> responseObserver)

Gets the configuration of a topic.

Parameters
Name Description
request GetTopicRequest
responseObserver io.grpc.stub.StreamObserver<Topic>

listTopicSnapshots(ListTopicSnapshotsRequest request, StreamObserver<ListTopicSnapshotsResponse> responseObserver)

public default void listTopicSnapshots(ListTopicSnapshotsRequest request, StreamObserver<ListTopicSnapshotsResponse> responseObserver)

Lists the names of the snapshots on this topic. Snapshots are used in Seek operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

Parameters
Name Description
request ListTopicSnapshotsRequest
responseObserver io.grpc.stub.StreamObserver<ListTopicSnapshotsResponse>

listTopicSubscriptions(ListTopicSubscriptionsRequest request, StreamObserver<ListTopicSubscriptionsResponse> responseObserver)

public default void listTopicSubscriptions(ListTopicSubscriptionsRequest request, StreamObserver<ListTopicSubscriptionsResponse> responseObserver)

Lists the names of the attached subscriptions on this topic.

Parameters
Name Description
request ListTopicSubscriptionsRequest
responseObserver io.grpc.stub.StreamObserver<ListTopicSubscriptionsResponse>

listTopics(ListTopicsRequest request, StreamObserver<ListTopicsResponse> responseObserver)

public default void listTopics(ListTopicsRequest request, StreamObserver<ListTopicsResponse> responseObserver)

Lists matching topics.

Parameters
Name Description
request ListTopicsRequest
responseObserver io.grpc.stub.StreamObserver<ListTopicsResponse>

publish(PublishRequest request, StreamObserver<PublishResponse> responseObserver)

public default void publish(PublishRequest request, StreamObserver<PublishResponse> responseObserver)

Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist.

Parameters
Name Description
request PublishRequest
responseObserver io.grpc.stub.StreamObserver<PublishResponse>

updateTopic(UpdateTopicRequest request, StreamObserver<Topic> responseObserver)

public default void updateTopic(UpdateTopicRequest request, StreamObserver<Topic> responseObserver)

Updates an existing topic by updating the fields specified in the update mask. Note that certain properties of a topic are not modifiable.

Parameters
Name Description
request UpdateTopicRequest
responseObserver io.grpc.stub.StreamObserver<Topic>