Cloud Pub/Sub v1 API - Class Publisher.PublisherBase (3.12.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
NameDescription
requestTopic

The request received from the client.

contextServerCallContext

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

Returns
TypeDescription
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
NameDescription
requestDeleteTopicRequest

The request received from the client.

contextServerCallContext

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

Returns
TypeDescription
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
NameDescription
requestDetachSubscriptionRequest

The request received from the client.

contextServerCallContext

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

Returns
TypeDescription
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
NameDescription
requestGetTopicRequest

The request received from the client.

contextServerCallContext

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

Returns
TypeDescription
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
NameDescription
requestListTopicSnapshotsRequest

The request received from the client.

contextServerCallContext

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

Returns
TypeDescription
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
NameDescription
requestListTopicSubscriptionsRequest

The request received from the client.

contextServerCallContext

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

Returns
TypeDescription
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
NameDescription
requestListTopicsRequest

The request received from the client.

contextServerCallContext

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

Returns
TypeDescription
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
NameDescription
requestPublishRequest

The request received from the client.

contextServerCallContext

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

Returns
TypeDescription
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
NameDescription
requestUpdateTopicRequest

The request received from the client.

contextServerCallContext

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

Returns
TypeDescription
TaskTopic

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