Cloud Pub/Sub v1 API - Class Publisher.PublisherBase (3.16.0)

[BindServiceMethod(typeof(Publisher), "BindService")]
public abstract class Publisher.PublisherBase

Reference documentation and code samples for the Cloud Pub/Sub v1 API class Publisher.PublisherBase.

Base class for server-side implementations of Publisher

Inheritance

object > Publisher.PublisherBase

Namespace

Google.Cloud.PubSub.V1

Assembly

Google.Cloud.PubSub.V1.dll

Methods

CreateTopic(Topic, ServerCallContext)

public virtual Task<Topic> CreateTopic(Topic request, ServerCallContext context)

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

Parameters
Name Description
request Topic

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskTopic

The response to send back to the client (wrapped by a task).

DeleteTopic(DeleteTopicRequest, ServerCallContext)

public virtual Task<Empty> DeleteTopic(DeleteTopicRequest request, ServerCallContext context)

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

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskEmpty

The response to send back to the client (wrapped by a task).

DetachSubscription(DetachSubscriptionRequest, ServerCallContext)

public virtual Task<DetachSubscriptionResponse> DetachSubscription(DetachSubscriptionRequest request, ServerCallContext context)

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

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskDetachSubscriptionResponse

The response to send back to the client (wrapped by a task).

GetTopic(GetTopicRequest, ServerCallContext)

public virtual Task<Topic> GetTopic(GetTopicRequest request, ServerCallContext context)

Gets the configuration of a topic.

Parameters
Name Description
request GetTopicRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskTopic

The response to send back to the client (wrapped by a task).

ListTopicSnapshots(ListTopicSnapshotsRequest, ServerCallContext)

public virtual Task<ListTopicSnapshotsResponse> ListTopicSnapshots(ListTopicSnapshotsRequest request, ServerCallContext context)

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

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskListTopicSnapshotsResponse

The response to send back to the client (wrapped by a task).

ListTopicSubscriptions(ListTopicSubscriptionsRequest, ServerCallContext)

public virtual Task<ListTopicSubscriptionsResponse> ListTopicSubscriptions(ListTopicSubscriptionsRequest request, ServerCallContext context)

Lists the names of the attached subscriptions on this topic.

Parameters
Name Description
request ListTopicSubscriptionsRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskListTopicSubscriptionsResponse

The response to send back to the client (wrapped by a task).

ListTopics(ListTopicsRequest, ServerCallContext)

public virtual Task<ListTopicsResponse> ListTopics(ListTopicsRequest request, ServerCallContext context)

Lists matching topics.

Parameters
Name Description
request ListTopicsRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskListTopicsResponse

The response to send back to the client (wrapped by a task).

Publish(PublishRequest, ServerCallContext)

public virtual Task<PublishResponse> Publish(PublishRequest request, ServerCallContext context)

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

Parameters
Name Description
request PublishRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskPublishResponse

The response to send back to the client (wrapped by a task).

UpdateTopic(UpdateTopicRequest, ServerCallContext)

public virtual Task<Topic> UpdateTopic(UpdateTopicRequest request, ServerCallContext context)

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

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskTopic

The response to send back to the client (wrapped by a task).