public sealed class SubscriberServiceApiClientImpl : SubscriberServiceApiClient
Reference documentation and code samples for the Cloud Pub/Sub v1 API class SubscriberServiceApiClientImpl.
SubscriberServiceApi client wrapper implementation, for convenient use.
Namespace
Google.Cloud.PubSub.V1Assembly
Google.Cloud.PubSub.V1.dll
Remarks
The service that an application uses to manipulate subscriptions and to
consume messages from a subscription via the Pull
method or by
establishing a bi-directional stream using the StreamingPull
method.
Constructors
SubscriberServiceApiClientImpl(Subscriber.SubscriberClient, SubscriberServiceApiSettings, ILogger)
public SubscriberServiceApiClientImpl(Subscriber.SubscriberClient grpcClient, SubscriberServiceApiSettings settings, ILogger logger)
Constructs a client wrapper for the SubscriberServiceApi service, with the specified gRPC client and settings.
Parameters | |
---|---|
Name | Description |
grpcClient | Subscriber.SubscriberClient The underlying gRPC client. |
settings | SubscriberServiceApiSettings The base SubscriberServiceApiSettings used within this client. |
logger | ILogger Optional ILogger to use within this client. |
Properties
GrpcClient
public override Subscriber.SubscriberClient GrpcClient { get; }
The underlying gRPC SubscriberServiceApi client
Property Value | |
---|---|
Type | Description |
Subscriber.SubscriberClient |
IAMPolicyClient
public override IAMPolicyClient IAMPolicyClient { get; }
The IAMPolicyClient associated with this client.
Property Value | |
---|---|
Type | Description |
IAMPolicyClient |
Methods
Acknowledge(AcknowledgeRequest, CallSettings)
public override void Acknowledge(AcknowledgeRequest request, CallSettings callSettings = null)
Acknowledges the messages associated with the ack_ids
in the
AcknowledgeRequest
. The Pub/Sub system can remove the relevant messages
from the subscription.
Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error.
Parameters | |
---|---|
Name | Description |
request | AcknowledgeRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
AcknowledgeAsync(AcknowledgeRequest, CallSettings)
public override Task AcknowledgeAsync(AcknowledgeRequest request, CallSettings callSettings = null)
Acknowledges the messages associated with the ack_ids
in the
AcknowledgeRequest
. The Pub/Sub system can remove the relevant messages
from the subscription.
Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error.
Parameters | |
---|---|
Name | Description |
request | AcknowledgeRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
CreateSnapshot(CreateSnapshotRequest, CallSettings)
public override Snapshot CreateSnapshot(CreateSnapshotRequest request, CallSettings callSettings = null)
Creates a snapshot from the requested subscription. 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.
If the snapshot already exists, returns ALREADY_EXISTS
.
If the requested subscription doesn't exist, returns NOT_FOUND
.
If the backlog in the subscription is too old -- and the resulting snapshot
would expire in less than 1 hour -- then FAILED_PRECONDITION
is returned.
See also the Snapshot.expire_time
field. If the name is not provided in
the request, the server will assign a random
name for this snapshot on the same project as the subscription, conforming
to the resource name format. The
generated name is populated in the returned Snapshot object. Note that for
REST API requests, you must specify a name in the request.
Parameters | |
---|---|
Name | Description |
request | CreateSnapshotRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Snapshot | The RPC response. |
CreateSnapshotAsync(CreateSnapshotRequest, CallSettings)
public override Task<Snapshot> CreateSnapshotAsync(CreateSnapshotRequest request, CallSettings callSettings = null)
Creates a snapshot from the requested subscription. 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.
If the snapshot already exists, returns ALREADY_EXISTS
.
If the requested subscription doesn't exist, returns NOT_FOUND
.
If the backlog in the subscription is too old -- and the resulting snapshot
would expire in less than 1 hour -- then FAILED_PRECONDITION
is returned.
See also the Snapshot.expire_time
field. If the name is not provided in
the request, the server will assign a random
name for this snapshot on the same project as the subscription, conforming
to the resource name format. The
generated name is populated in the returned Snapshot object. Note that for
REST API requests, you must specify a name in the request.
Parameters | |
---|---|
Name | Description |
request | CreateSnapshotRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Snapshot> | A Task containing the RPC response. |
CreateSubscription(Subscription, CallSettings)
public override Subscription CreateSubscription(Subscription request, CallSettings callSettings = null)
Creates a subscription to a given topic. See the resource name rules.
If the subscription already exists, returns ALREADY_EXISTS
.
If the corresponding topic doesn't exist, returns NOT_FOUND
.
If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic, conforming to the resource name format. The generated name is populated in the returned Subscription object. Note that for REST API requests, you must specify a name in the request.
Parameters | |
---|---|
Name | Description |
request | Subscription The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Subscription | The RPC response. |
CreateSubscriptionAsync(Subscription, CallSettings)
public override Task<Subscription> CreateSubscriptionAsync(Subscription request, CallSettings callSettings = null)
Creates a subscription to a given topic. See the resource name rules.
If the subscription already exists, returns ALREADY_EXISTS
.
If the corresponding topic doesn't exist, returns NOT_FOUND
.
If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic, conforming to the resource name format. The generated name is populated in the returned Subscription object. Note that for REST API requests, you must specify a name in the request.
Parameters | |
---|---|
Name | Description |
request | Subscription The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Subscription> | A Task containing the RPC response. |
DeleteSnapshot(DeleteSnapshotRequest, CallSettings)
public override void DeleteSnapshot(DeleteSnapshotRequest request, CallSettings callSettings = null)
Removes an existing snapshot. 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. When the snapshot is deleted, all messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new one may be created with the same name, but the new one has no association with the old snapshot or its subscription, unless the same subscription is specified.
Parameters | |
---|---|
Name | Description |
request | DeleteSnapshotRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
DeleteSnapshotAsync(DeleteSnapshotRequest, CallSettings)
public override Task DeleteSnapshotAsync(DeleteSnapshotRequest request, CallSettings callSettings = null)
Removes an existing snapshot. 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. When the snapshot is deleted, all messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new one may be created with the same name, but the new one has no association with the old snapshot or its subscription, unless the same subscription is specified.
Parameters | |
---|---|
Name | Description |
request | DeleteSnapshotRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
DeleteSubscription(DeleteSubscriptionRequest, CallSettings)
public override void DeleteSubscription(DeleteSubscriptionRequest request, CallSettings callSettings = null)
Deletes an existing subscription. All messages retained in the subscription
are immediately dropped. Calls to Pull
after deletion will return
NOT_FOUND
. After a subscription is deleted, a new one may be created with
the same name, but the new one has no association with the old
subscription or its topic unless the same topic is specified.
Parameters | |
---|---|
Name | Description |
request | DeleteSubscriptionRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
DeleteSubscriptionAsync(DeleteSubscriptionRequest, CallSettings)
public override Task DeleteSubscriptionAsync(DeleteSubscriptionRequest request, CallSettings callSettings = null)
Deletes an existing subscription. All messages retained in the subscription
are immediately dropped. Calls to Pull
after deletion will return
NOT_FOUND
. After a subscription is deleted, a new one may be created with
the same name, but the new one has no association with the old
subscription or its topic unless the same topic is specified.
Parameters | |
---|---|
Name | Description |
request | DeleteSubscriptionRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
GetSnapshot(GetSnapshotRequest, CallSettings)
public override Snapshot GetSnapshot(GetSnapshotRequest request, CallSettings callSettings = null)
Gets the configuration details of a snapshot. Snapshots are used in <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> 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 | GetSnapshotRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Snapshot | The RPC response. |
GetSnapshotAsync(GetSnapshotRequest, CallSettings)
public override Task<Snapshot> GetSnapshotAsync(GetSnapshotRequest request, CallSettings callSettings = null)
Gets the configuration details of a snapshot. Snapshots are used in <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> 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 | GetSnapshotRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Snapshot> | A Task containing the RPC response. |
GetSubscription(GetSubscriptionRequest, CallSettings)
public override Subscription GetSubscription(GetSubscriptionRequest request, CallSettings callSettings = null)
Gets the configuration details of a subscription.
Parameters | |
---|---|
Name | Description |
request | GetSubscriptionRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Subscription | The RPC response. |
GetSubscriptionAsync(GetSubscriptionRequest, CallSettings)
public override Task<Subscription> GetSubscriptionAsync(GetSubscriptionRequest request, CallSettings callSettings = null)
Gets the configuration details of a subscription.
Parameters | |
---|---|
Name | Description |
request | GetSubscriptionRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Subscription> | A Task containing the RPC response. |
ListSnapshots(ListSnapshotsRequest, CallSettings)
public override PagedEnumerable<ListSnapshotsResponse, Snapshot> ListSnapshots(ListSnapshotsRequest request, CallSettings callSettings = null)
Lists the existing snapshots. 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 | ListSnapshotsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListSnapshotsResponse, Snapshot> | A pageable sequence of Snapshot resources. |
ListSnapshotsAsync(ListSnapshotsRequest, CallSettings)
public override PagedAsyncEnumerable<ListSnapshotsResponse, Snapshot> ListSnapshotsAsync(ListSnapshotsRequest request, CallSettings callSettings = null)
Lists the existing snapshots. 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 | ListSnapshotsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListSnapshotsResponse, Snapshot> | A pageable asynchronous sequence of Snapshot resources. |
ListSubscriptions(ListSubscriptionsRequest, CallSettings)
public override PagedEnumerable<ListSubscriptionsResponse, Subscription> ListSubscriptions(ListSubscriptionsRequest request, CallSettings callSettings = null)
Lists matching subscriptions.
Parameters | |
---|---|
Name | Description |
request | ListSubscriptionsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListSubscriptionsResponse, Subscription> | A pageable sequence of Subscription resources. |
ListSubscriptionsAsync(ListSubscriptionsRequest, CallSettings)
public override PagedAsyncEnumerable<ListSubscriptionsResponse, Subscription> ListSubscriptionsAsync(ListSubscriptionsRequest request, CallSettings callSettings = null)
Lists matching subscriptions.
Parameters | |
---|---|
Name | Description |
request | ListSubscriptionsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListSubscriptionsResponse, Subscription> | A pageable asynchronous sequence of Subscription resources. |
ModifyAckDeadline(ModifyAckDeadlineRequest, CallSettings)
public override void ModifyAckDeadline(ModifyAckDeadlineRequest request, CallSettings callSettings = null)
Modifies the ack deadline for a specific message. This method is useful
to indicate that more time is needed to process a message by the
subscriber, or to make the message available for redelivery if the
processing was interrupted. Note that this does not modify the
subscription-level ackDeadlineSeconds
used for subsequent messages.
Parameters | |
---|---|
Name | Description |
request | ModifyAckDeadlineRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
ModifyAckDeadlineAsync(ModifyAckDeadlineRequest, CallSettings)
public override Task ModifyAckDeadlineAsync(ModifyAckDeadlineRequest request, CallSettings callSettings = null)
Modifies the ack deadline for a specific message. This method is useful
to indicate that more time is needed to process a message by the
subscriber, or to make the message available for redelivery if the
processing was interrupted. Note that this does not modify the
subscription-level ackDeadlineSeconds
used for subsequent messages.
Parameters | |
---|---|
Name | Description |
request | ModifyAckDeadlineRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
ModifyPushConfig(ModifyPushConfigRequest, CallSettings)
public override void ModifyPushConfig(ModifyPushConfigRequest request, CallSettings callSettings = null)
Modifies the PushConfig
for a specified subscription.
This may be used to change a push subscription to a pull one (signified by
an empty PushConfig
) or vice versa, or change the endpoint URL and other
attributes of a push subscription. Messages will accumulate for delivery
continuously through the call regardless of changes to the PushConfig
.
Parameters | |
---|---|
Name | Description |
request | ModifyPushConfigRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
ModifyPushConfigAsync(ModifyPushConfigRequest, CallSettings)
public override Task ModifyPushConfigAsync(ModifyPushConfigRequest request, CallSettings callSettings = null)
Modifies the PushConfig
for a specified subscription.
This may be used to change a push subscription to a pull one (signified by
an empty PushConfig
) or vice versa, or change the endpoint URL and other
attributes of a push subscription. Messages will accumulate for delivery
continuously through the call regardless of changes to the PushConfig
.
Parameters | |
---|---|
Name | Description |
request | ModifyPushConfigRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
Pull(PullRequest, CallSettings)
public override PullResponse Pull(PullRequest request, CallSettings callSettings = null)
Pulls messages from the server. The server may return UNAVAILABLE
if
there are too many concurrent pull requests pending for the given
subscription.
Parameters | |
---|---|
Name | Description |
request | PullRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PullResponse | The RPC response. |
PullAsync(PullRequest, CallSettings)
public override Task<PullResponse> PullAsync(PullRequest request, CallSettings callSettings = null)
Pulls messages from the server. The server may return UNAVAILABLE
if
there are too many concurrent pull requests pending for the given
subscription.
Parameters | |
---|---|
Name | Description |
request | PullRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<PullResponse> | A Task containing the RPC response. |
Seek(SeekRequest, CallSettings)
public override SeekResponse Seek(SeekRequest request, CallSettings callSettings = null)
Seeks an existing subscription to a point in time or to a given snapshot, whichever is provided in the request. 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. Note that both the subscription and the snapshot must be on the same topic.
Parameters | |
---|---|
Name | Description |
request | SeekRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
SeekResponse | The RPC response. |
SeekAsync(SeekRequest, CallSettings)
public override Task<SeekResponse> SeekAsync(SeekRequest request, CallSettings callSettings = null)
Seeks an existing subscription to a point in time or to a given snapshot, whichever is provided in the request. 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. Note that both the subscription and the snapshot must be on the same topic.
Parameters | |
---|---|
Name | Description |
request | SeekRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<SeekResponse> | A Task containing the RPC response. |
StreamingPull(CallSettings, BidirectionalStreamingSettings)
public override SubscriberServiceApiClient.StreamingPullStream StreamingPull(CallSettings callSettings = null, BidirectionalStreamingSettings streamingSettings = null)
Establishes a stream with the server, which sends messages down to the
client. The client streams acknowledgements and ack deadline modifications
back to the server. The server will close the stream and return the status
on any error. The server may close the stream with status UNAVAILABLE
to
reassign server-side resources, in which case, the client should
re-establish the stream. Flow control can be achieved by configuring the
underlying RPC channel.
Parameters | |
---|---|
Name | Description |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
streamingSettings | BidirectionalStreamingSettings If not null, applies streaming overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
SubscriberServiceApiClient.StreamingPullStream | The client-server stream. |
UpdateSnapshot(UpdateSnapshotRequest, CallSettings)
public override Snapshot UpdateSnapshot(UpdateSnapshotRequest request, CallSettings callSettings = null)
Updates an existing snapshot. Snapshots are used in <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> 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 | UpdateSnapshotRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Snapshot | The RPC response. |
UpdateSnapshotAsync(UpdateSnapshotRequest, CallSettings)
public override Task<Snapshot> UpdateSnapshotAsync(UpdateSnapshotRequest request, CallSettings callSettings = null)
Updates an existing snapshot. Snapshots are used in <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> 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 | UpdateSnapshotRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Snapshot> | A Task containing the RPC response. |
UpdateSubscription(UpdateSubscriptionRequest, CallSettings)
public override Subscription UpdateSubscription(UpdateSubscriptionRequest request, CallSettings callSettings = null)
Updates an existing subscription. Note that certain properties of a subscription, such as its topic, are not modifiable.
Parameters | |
---|---|
Name | Description |
request | UpdateSubscriptionRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Subscription | The RPC response. |
UpdateSubscriptionAsync(UpdateSubscriptionRequest, CallSettings)
public override Task<Subscription> UpdateSubscriptionAsync(UpdateSubscriptionRequest request, CallSettings callSettings = null)
Updates an existing subscription. Note that certain properties of a subscription, such as its topic, are not modifiable.
Parameters | |
---|---|
Name | Description |
request | UpdateSubscriptionRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Subscription> | A Task containing the RPC response. |